diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a0b30fb..fcda310 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -272,6 +272,8 @@ PODS: - React-jsinspector (0.66.0) - React-logger (0.66.0): - glog + - react-native-restart (0.0.22): + - React-Core - react-native-safe-area-context (3.3.2): - React-Core - React-perflogger (0.66.0) @@ -341,9 +343,13 @@ PODS: - React-perflogger (= 0.66.0) - RNCAsyncStorage (1.15.9): - React-Core + - RNDeviceInfo (8.4.5): + - React-Core - RNScreens (3.8.0): - React-Core - React-RCTImage + - RNVectorIcons (8.1.0): + - React-Core - Yoga (1.14.0) - YogaKit (1.18.1): - Yoga (~> 1.14) @@ -389,6 +395,7 @@ DEPENDENCIES: - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - React-logger (from `../node_modules/react-native/ReactCommon/logger`) + - react-native-restart (from `../node_modules/react-native-restart`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) @@ -403,7 +410,9 @@ DEPENDENCIES: - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" + - RNDeviceInfo (from `../node_modules/react-native-device-info`) - RNScreens (from `../node_modules/react-native-screens`) + - RNVectorIcons (from `../node_modules/react-native-vector-icons`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -458,6 +467,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsinspector" React-logger: :path: "../node_modules/react-native/ReactCommon/logger" + react-native-restart: + :path: "../node_modules/react-native-restart" react-native-safe-area-context: :path: "../node_modules/react-native-safe-area-context" React-perflogger: @@ -486,8 +497,12 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon" RNCAsyncStorage: :path: "../node_modules/@react-native-async-storage/async-storage" + RNDeviceInfo: + :path: "../node_modules/react-native-device-info" RNScreens: :path: "../node_modules/react-native-screens" + RNVectorIcons: + :path: "../node_modules/react-native-vector-icons" Yoga: :path: "../node_modules/react-native/ReactCommon/yoga" @@ -522,6 +537,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 6a05173dc0142abc582bd4edd2d23146b8cc218a React-jsinspector: be95ad424ba9f7b817aff22732eb9b1b810a000a React-logger: 9a9cd87d4ea681ae929b32ef580638ff1b50fb24 + react-native-restart: d4ea7637e193da7558d229b3704d500ec0d75f9c react-native-safe-area-context: 5cf05f49df9d17261e40e518481f2e334c6cd4b5 React-perflogger: 1f554c2b684e2f484f9edcdfdaeedab039fbaca8 React-RCTActionSheet: 610d5a5d71ab4808734782c8bca6a12ec3563672 @@ -536,7 +552,9 @@ SPEC CHECKSUMS: React-runtimeexecutor: 4bb657a97aa74568d9ed634c8bd478299bb8a3a6 ReactCommon: eb059748e842a1a86025ebbd4ac9d99e74492f88 RNCAsyncStorage: d599364c12b1ddb042cc2d7ab6f8258962b83097 + RNDeviceInfo: 3b3bbe00f478907223daa580b6882f0bae162f72 RNScreens: 6e1ea5787989f92b0671049b808aef64fa1ef98c + RNVectorIcons: 31cebfcf94e8cf8686eb5303ae0357da64d7a5a4 Yoga: c11abbf5809216c91fcd62f5571078b83d9b6720 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/ios/RnDanovin.xcodeproj/project.pbxproj b/ios/RnDanovin.xcodeproj/project.pbxproj index 3e2e116..be143c8 100644 --- a/ios/RnDanovin.xcodeproj/project.pbxproj +++ b/ios/RnDanovin.xcodeproj/project.pbxproj @@ -364,7 +364,6 @@ ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RnDanovin/Pods-RnDanovin-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -557,6 +556,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = M52GT6568Q; ENABLE_BITCODE = NO; INFOPLIST_FILE = RnDanovin/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -583,6 +583,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = M52GT6568Q; INFOPLIST_FILE = RnDanovin/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/RnDanovin/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/RnDanovin/Images.xcassets/AppIcon.appiconset/Contents.json index 118c98f..8121323 100644 --- a/ios/RnDanovin/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/RnDanovin/Images.xcassets/AppIcon.appiconset/Contents.json @@ -2,37 +2,52 @@ "images" : [ { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/navigation.js b/navigation.js index 941e19d..301fb51 100644 --- a/navigation.js +++ b/navigation.js @@ -22,8 +22,8 @@ function Navigator(props) { {!props.profile.token ? ( <> - - + + ) : ( <> @@ -35,4 +35,4 @@ function Navigator(props) { ); } -export default connect(mapStateToProps)(Navigator); \ No newline at end of file +export default connect(mapStateToProps)(Navigator); diff --git a/package-lock.json b/package-lock.json index b2c336b..b36c03c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7471,6 +7471,11 @@ "nullthrows": "^1.1.1" } }, + "react-native-device-info": { + "version": "8.4.5", + "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-8.4.5.tgz", + "integrity": "sha512-0uKO9rBF4Uv8X+xLJdR6HkuyB2C4gNEcWdHPcS1MhtsIExP6NTbC3tgkrUUWZ7HODbn1MFx5LG5cGDe4X0zhWA==" + }, "react-native-iphone-x-helper": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz", @@ -7486,6 +7491,11 @@ "react-native-iphone-x-helper": "^1.3.1" } }, + "react-native-restart": { + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/react-native-restart/-/react-native-restart-0.0.22.tgz", + "integrity": "sha512-XwCqAMAKsO8yCM3xACPFKvkDQZe41lcavOuO0gUEu803IuTLtciualCq/qs83ryRDCDh1jkXYRqFjsGjLMCN3Q==" + }, "react-native-safe-area-context": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-3.3.2.tgz", diff --git a/package.json b/package.json index 67f6043..527665b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "react": "17.0.2", "react-native": "0.66.0", "react-native-awesome-alerts": "^1.5.2", + "react-native-device-info": "^8.4.5", "react-native-paper": "^4.9.2", + "react-native-restart": "0.0.22", "react-native-safe-area-context": "^3.3.2", "react-native-screens": "^3.8.0", "react-native-select-dropdown": "^1.2.0", diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..42ea219 Binary files /dev/null and b/src/assets/images/logo.png differ diff --git a/src/screens/Home/components/2d.js b/src/screens/Home/components/2d.js new file mode 100644 index 0000000..fbcbd69 --- /dev/null +++ b/src/screens/Home/components/2d.js @@ -0,0 +1,23 @@ +import React from "react"; +import { View, StyleSheet, Dimensions } from "react-native"; +import Identifier from "./Identifier"; + +function component2D({ list, flexDirection }) { + return ( + + {list.map((item, i) => ( + + ))} + + ); +} + +const { width } = Dimensions.get("window"); +const styles = StyleSheet.create({ + container: { + // width, + borderRadius: 10, + flex: 1 + } +}); +export default component2D; diff --git a/src/screens/Home/components/3d.js b/src/screens/Home/components/3d.js new file mode 100644 index 0000000..f12c65d --- /dev/null +++ b/src/screens/Home/components/3d.js @@ -0,0 +1,24 @@ +import React from "react"; +import { View, StyleSheet, Dimensions } from "react-native"; +import Identifier from "./Identifier"; + +function component3D({ list }) { + return ( + + {list.map((item, i) => ( + + ))} + + ); +} + +const { width } = Dimensions.get("window"); +const styles = StyleSheet.create({ + container: { + // width, + borderRadius: 10, + flex: 1, + flexDirection: "row-reverse" + } +}); +export default component3D; diff --git a/src/screens/Home/components/Identifier.js b/src/screens/Home/components/Identifier.js new file mode 100644 index 0000000..5537697 --- /dev/null +++ b/src/screens/Home/components/Identifier.js @@ -0,0 +1,38 @@ +import React from "react"; +import Carousel from "./carousel"; +import Component2D from "./2d"; +import Component3D from "./3d"; +import FlexAround from "./flexAround"; +import BackgroundTile from "./backgroundTile"; +import Shop from "./shop.js"; + +const Identifier = (item) => { + let component; + switch (item.name) { + case "carousel": + component = ; + break; + case "2d": + component = ( + + ); + break; + case "3d": + component = ; + break; + case "flex-around": + component = ; + break; + case "background-tile": + component = ; + break; + case "shop": + component = ; + break; + default: + component = null; + } + return <>{component}; +}; + +export default Identifier; diff --git a/src/screens/Home/components/backgroundTile.js b/src/screens/Home/components/backgroundTile.js new file mode 100644 index 0000000..13d5a38 --- /dev/null +++ b/src/screens/Home/components/backgroundTile.js @@ -0,0 +1,49 @@ +import React from "react"; +import { StyleSheet, View, Text, ImageBackground } from "react-native"; + +const backgroundTile = ({ item }) => { + return ( + + + {item.title} + {item.subTitle} + + + ); +}; + +const styles = StyleSheet.create({ + container: { + margin: 5, + borderRadius: 10 + }, + cover: { + minHeight: "100%", + minWidth: "100%", + flexDirection: "column", + justifyContent: "center", + padding: 10, + borderRadius: 10 + }, + title: { + fontSize: 21, + fontWeight: 600, + marginBottom: 5, + color: "white" + }, + subTitle: { + fontSize: 14, + color: "white" + } +}); + +export default backgroundTile; diff --git a/src/screens/Home/components/carousel.js b/src/screens/Home/components/carousel.js new file mode 100644 index 0000000..13325df --- /dev/null +++ b/src/screens/Home/components/carousel.js @@ -0,0 +1,50 @@ +import React from "react"; +import { ImageBackground, Dimensions, StyleSheet, View } from "react-native"; +// import { SwiperFlatList } from "react-native-swiper-flatlist"; + +const Carousel = ({ list }) => { + return ( + + {/* (*/} + {/* */} + {/* */} + {/* */} + {/* )}*/} + {/*/>*/} + + ); +}; + +const { width } = Dimensions.get("window"); +const styles = StyleSheet.create({ + container: { + minHeight: 300, + borderRadius: 10, + margin: 5 + }, + child: { + width, + justifyContent: "center", + borderRadius: 10, + alignItems: "center" + }, + image: { + width, + flex: 1, + justifyContent: "center", + borderRadius: 10 + } +}); + +export default Carousel; diff --git a/src/screens/Home/components/flexAround.js b/src/screens/Home/components/flexAround.js new file mode 100644 index 0000000..1ac1e81 --- /dev/null +++ b/src/screens/Home/components/flexAround.js @@ -0,0 +1,52 @@ +import React from "react"; +import { StyleSheet, View, Text, Image } from "react-native"; + +const FlexAround = ({ item }) => { + return ( + + + {item.title} + {item.subTitle} + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + borderRadius: 10, + flex: 1, + paddingVertical: 30, + flexDirection: "row-reverse", + alignItems: "center", + justifyContent: "space-around", + textAlign: "right", + margin: 5 + }, + column: { + display: "flex", + flexDirection: "column" + }, + image: { + width: 60, + height: 60 + }, + title: { + fontSize: 21, + fontWeight: 600, + marginBottom: 5, + color: "white" + }, + subTitle: { + fontSize: 14, + color: "white" + } +}); + +export default FlexAround; diff --git a/src/screens/Home/components/shop.js b/src/screens/Home/components/shop.js new file mode 100644 index 0000000..9e21efc --- /dev/null +++ b/src/screens/Home/components/shop.js @@ -0,0 +1,54 @@ +import React from "react"; +import { StyleSheet, View, Text, Image } from "react-native"; + +const Shop = ({ item }) => { + return ( + + {item.title} + + + {item.items.map((item1) => ( + + + + ))} + + + ); +}; + +const styles = StyleSheet.create({ + container: { + borderRadius: 10, + flex: 1, + paddingVertical: 5, + paddingHorizontal: 10, + flexDirection: "column", + textAlign: "right", + margin: 5 + }, + list: { + display: "flex", + flexDirection: "row", + justifyContent: "space-around", + marginTop: 10 + }, + product: { + width: 50, + height: 65, + borderRadius: 10 + }, + title: { + fontSize: 18, + fontWeight: 600, + marginBottom: 5, + color: "white" + } +}); + +export default Shop; diff --git a/src/screens/Home/data.js b/src/screens/Home/data.js new file mode 100644 index 0000000..aa4e695 --- /dev/null +++ b/src/screens/Home/data.js @@ -0,0 +1,140 @@ +const data = [ + { + name: "carousel", + list: [ + { + id: 0, + imageUrl: "https://dnvn.ir/api/v1/file/5299" + }, + { + id: 1, + imageUrl: "https://dnvn.ir/api/v1/file/6581" + }, + { + id: 2, + imageUrl: "https://dnvn.ir/api/v1/file/6586" + } + ] + }, + { + name: "2d", + flexDirection: "row-reverse", + items: [ + { + name: "flex-around", + title: "qr خوان", + subTitle: "در صفحات کتاب هوشمند", + imageUrl: "https://dnvn.ir/api/v1/file/1855", + backgroundColor: "blue", + flex: 1 + }, + { + name: "flex-around", + title: "واقعیت افزوده", + subTitle: "فعال شده و دیجیتال", + imageUrl: "https://dnvn.ir/api/v1/file/1851", + backgroundColor: "green", + flex: 1 + } + ] + }, + { + name: "2d", + flexDirection: "row-reverse", + items: [ + { + name: "flex-around", + title: "qr خوان", + subTitle: "در صفحات کتاب هوشمند", + imageUrl: "https://dnvn.ir/api/v1/file/1855", + backgroundColor: "blue", + flex: 1.6 + }, + { + name: "background-tile", + title: "کتاب های من", + subTitle: "فعال شده و دیجیتال", + imageUrl: "https://dnvn.ir/api/v1/file/1860", + backgroundColor: "#ff00ff77", + flex: 1, + alignItems: "flex-end" + } + ] + }, + { + name: "2d", + flexDirection: "row-reverse", + items: [ + { + name: "background-tile", + title: "بلاگ", + subTitle: "", + imageUrl: "https://dnvn.ir/api/v1/file/1852", + backgroundColor: "#00ff0066", + flex: 1, + alignItems: "center" + }, + { + name: "shop", + title: "فروشگاه", + backgroundColor: "#8888ff", + flex: 1.6, + items: [ + { + id: 0, + imageUrl: "https://dnvn.ir/api/v1/file/1857" + }, + { + id: 1, + imageUrl: "https://dnvn.ir/api/v1/file/1858" + }, + { + id: 2, + imageUrl: "https://dnvn.ir/api/v1/file/1859" + } + ] + } + ] + }, + { + name: "3d", + items: [ + { + name: "2d", + flexDirection: "column", + items: [ + { + name: "background-tile", + title: "پیگیری سفارشات", + subTitle: "", + imageUrl: "", + backgroundColor: "#ff5555", + flex: 1, + alignItems: "center" + }, + { + name: "background-tile", + title: "پشتیبانی", + subTitle: "", + imageUrl: "", + backgroundColor: "#ffaa00", + flex: 1, + alignItems: "center" + } + ] + }, + { + name: "background-tile", + title: "بلاگ", + subTitle: "", + imageUrl: "https://dnvn.ir/api/v1/file/1853", + backgroundColor: "#00ffff66", + flex: 1, + alignItems: "center" + } + ] + } + ]; + + export default data; + \ No newline at end of file diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index 06dc4f1..73e83eb 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -1,13 +1,27 @@ -import React from 'react' -import { View, Text } from 'react-native'; -import {connect} from 'react-redux'; +import React from "react"; +import { View, StyleSheet, Dimensions, ScrollView } from "react-native"; +import data from "./data"; +import Identifier from "./components/Identifier"; -function Home({}) { +// Within your render function +function Home() { return ( - - - - ) + + {data?.map((item, i) => ( + + ))} + + ); } +// Later on in your styles.. +const styles = StyleSheet.create({ + container: { + width: Dimensions.get("window").width, + backgroundColor: "white", + flexDirection: "column", + padding: 5 + } +}); + export default Home; diff --git a/src/screens/Home/navbar.js b/src/screens/Home/navbar.js new file mode 100644 index 0000000..be461ec --- /dev/null +++ b/src/screens/Home/navbar.js @@ -0,0 +1,46 @@ +import React from "react"; + +import { Button, StyleSheet, Text, View, Dimensions } from "react-native"; + +function App() { + return ( + + + دانوین + +