parent
							
								
									92e988a168
								
							
						
					
					
						commit
						318f9fad97
					
				
				 4 changed files with 102 additions and 2 deletions
			
			
		| @ -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…
					
					
				
		Reference in new issue