reza fixed my course

master
Reza_ashrafi 3 years ago
parent 92e988a168
commit 318f9fad97
  1. 3
      navigation/index.js
  2. 3
      src/components/Empty.js
  3. 2
      src/screens/Profile/components/List.js
  4. 96
      src/screens/Profile/components/MyCourses/index.js

@ -39,6 +39,7 @@ import Blog from "../src/screens/Blog";
import Sample from "../src/screens/Product/components/Sample"; import Sample from "../src/screens/Product/components/Sample";
import Info from "../src/screens/Product/components/Info"; import Info from "../src/screens/Product/components/Info";
import Rules from "../src/screens/Rules/index"; import Rules from "../src/screens/Rules/index";
import MyCourses from "../src/screens/Profile/components/MyCourses";
//style //style
import Colors from "../src/constants/Colors"; import Colors from "../src/constants/Colors";
@ -434,7 +435,9 @@ const PROFILEStackScreen = () => {
> >
<PROFILEStack.Screen name="Profile" component={Profile} /> <PROFILEStack.Screen name="Profile" component={Profile} />
<PROFILEStack.Screen name="ProfileBookmark" component={ProfileBookmark} /> <PROFILEStack.Screen name="ProfileBookmark" component={ProfileBookmark} />
<ProductsStack.Screen name="Products" component={Products} />
<PROFILEStack.Screen name="Product" component={Product} /> <PROFILEStack.Screen name="Product" component={Product} />
<PROFILEStack.Screen name="MyCourses" component={MyCourses} />
</PROFILEStack.Navigator> </PROFILEStack.Navigator>
); );
}; };

@ -8,15 +8,16 @@ import tw from "tailwind-rn";
import fontSize from "../constants/fontSize"; import fontSize from "../constants/fontSize";
const Empty = ({ text, buttonText, buttonAction, theme }) => { const Empty = ({ text, buttonText, buttonAction, theme }) => {
console.log('first');
return ( return (
<View style={tw("flex-1 flex justify-center items-center")}> <View style={tw("flex-1 flex justify-center items-center")}>
<Text <Text
style={[ style={[
tw("text-gray-500"),
{ {
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
transform: [{ translateY: -50 }], transform: [{ translateY: -50 }],
color : Colors.theme1[theme].gray20
}, },
]} ]}
> >

@ -133,7 +133,7 @@ const List = ({ mobile, theme }) => {
</Svg> </Svg>
), ),
name: "دورههای من", name: "دورههای من",
onPress: () => {}, onPress: () => navigation.push("MyCourses"),
}, },
{ {
icon: ( icon: (

@ -0,0 +1,96 @@
import {
View,
SafeAreaView,
ScrollView,
StyleSheet,
Platform,
Dimensions,
StatusBar,
} from "react-native";
import React from "react";
import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
//components
import Navbar from "../../../../components/Navbar";
import Empty from "../../../../components/Empty";
import Blur from "../../../../components/Blur";
//style
import tw from "tailwind-rn";
import Colors from "../../../../constants/Colors";
import fontSize from "../../../../constants/fontSize";
const { height, width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
const ProfileBookmark = ({ myCourses = [], mobile, theme }) => {
const navigation = useNavigation();
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
backgroundColor: "white",
flex: 1,
}}
>
<Navbar
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "دوره های من",
bookmark: false,
qr: false,
back: true,
}}
/>
{myCourses.length ? (
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
<View style={tw("w-full mt-2 px-4")}>
<View style={tw("p-0 m-0 flex")}>
{myCourses?.map((course, index) => (
<Course key={index} mobile={mobile} theme={theme} />
))}
</View>
</View>
</ScrollView>
) : (
<Empty
text="هیچ دوره ویدئویی وجود ندارد."
buttonText={"رفتن به فروشگاه"}
buttonAction={() => navigation.push("Products")}
/>
)}
</SafeAreaView>
);
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme,
});
export default connect(mapStateToProps)(ProfileBookmark);
const Course = ({ mobile, theme }) => {
return <View></View>;
};
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 100,
position: "relative",
},
container: {
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 0,
paddingHorizontal: 0,
},
});
Loading…
Cancel
Save