diff --git a/navigation/index.js b/navigation/index.js index f345110..db95d53 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -39,6 +39,7 @@ import Blog from "../src/screens/Blog"; import Sample from "../src/screens/Product/components/Sample"; import Info from "../src/screens/Product/components/Info"; import Rules from "../src/screens/Rules/index"; +import MyCourses from "../src/screens/Profile/components/MyCourses"; //style import Colors from "../src/constants/Colors"; @@ -434,7 +435,9 @@ const PROFILEStackScreen = () => { > + + ); }; diff --git a/src/components/Empty.js b/src/components/Empty.js index 888e5ae..c027699 100644 --- a/src/components/Empty.js +++ b/src/components/Empty.js @@ -8,15 +8,16 @@ import tw from "tailwind-rn"; import fontSize from "../constants/fontSize"; const Empty = ({ text, buttonText, buttonAction, theme }) => { + console.log('first'); return ( diff --git a/src/screens/Profile/components/List.js b/src/screens/Profile/components/List.js index a0c96df..7547727 100644 --- a/src/screens/Profile/components/List.js +++ b/src/screens/Profile/components/List.js @@ -133,7 +133,7 @@ const List = ({ mobile, theme }) => { ), name: "دوره‌های من", - onPress: () => {}, + onPress: () => navigation.push("MyCourses"), }, { icon: ( diff --git a/src/screens/Profile/components/MyCourses/index.js b/src/screens/Profile/components/MyCourses/index.js new file mode 100644 index 0000000..e2250c2 --- /dev/null +++ b/src/screens/Profile/components/MyCourses/index.js @@ -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 ( + + + {myCourses.length ? ( + + + + {myCourses?.map((course, index) => ( + + ))} + + + + ) : ( + navigation.push("Products")} + /> + )} + + ); +}; + +const mapStateToProps = (state) => ({ + mobile: state.publicApi.mobile, + theme: state.publicApi.theme, +}); + +export default connect(mapStateToProps)(ProfileBookmark); + +const Course = ({ mobile, theme }) => { + return ; +}; + +const styles = StyleSheet.create({ + contentContainerStyle: { + paddingBottom: 100, + position: "relative", + }, + container: { + backgroundColor: "white", + flexDirection: "column", + paddingVertical: 0, + paddingHorizontal: 0, + }, +});