From 5ff1acee7182fb646cb52331f3db1e65e5ee09ad Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Sat, 16 Apr 2022 11:10:19 +0430 Subject: [PATCH] reza added something --- navigation/index.js | 1 + package.json | 1 - src/components/Drawer.js | 10 ++++++++-- src/screens/OrderDetails/components/Book.js | 2 -- src/screens/OrderDetails/index.js | 1 - src/screens/OrdersFollowUp/components/Order.js | 1 - src/screens/Otp/index.js | 4 ++-- src/screens/Products/components/Header.js | 1 - src/screens/Profile/components/User.js | 11 ++++++++++- src/screens/Splash/index.js | 3 ++- 10 files changed, 23 insertions(+), 12 deletions(-) diff --git a/navigation/index.js b/navigation/index.js index a3f6b23..074c92e 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -443,6 +443,7 @@ const Navigation = ({ getStatus, isLogin, userProducts, ltr, setLTR }) => { } getStatus(); }, []); + return ( { - { height: dropdownHeight, }, ]} + onPress={() => + asyncAwesomeAlert("نتیجه", "این قابلیت در حال توسعه است.", { + showCancelButton: false, + }) + } > { > + - + {routes.map((route, index) => ( diff --git a/src/screens/OrderDetails/components/Book.js b/src/screens/OrderDetails/components/Book.js index aa3af88..9eaa524 100644 --- a/src/screens/OrderDetails/components/Book.js +++ b/src/screens/OrderDetails/components/Book.js @@ -6,8 +6,6 @@ import tw from "tailwind-rn"; import fontSize from "../../../constants/fontSize"; import Colors from "../../../constants/Colors"; -import _ from "lodash"; - const width = Dimensions.get("window").width; function Book({ book, mobile, grades, theme }) { diff --git a/src/screens/OrderDetails/index.js b/src/screens/OrderDetails/index.js index 1239f94..f045abd 100644 --- a/src/screens/OrderDetails/index.js +++ b/src/screens/OrderDetails/index.js @@ -11,7 +11,6 @@ import { LayoutAnimation, } from "react-native"; import { connect } from "react-redux"; -import _ from "lodash"; import moment from "jalali-moment"; //components diff --git a/src/screens/OrdersFollowUp/components/Order.js b/src/screens/OrdersFollowUp/components/Order.js index 60653e6..ac9f43f 100644 --- a/src/screens/OrdersFollowUp/components/Order.js +++ b/src/screens/OrdersFollowUp/components/Order.js @@ -10,7 +10,6 @@ import { import { useNavigation } from "@react-navigation/native"; import { connect } from "react-redux"; import Svg, { Path } from "react-native-svg"; -import _ from "lodash"; import moment from "jalali-moment"; //style diff --git a/src/screens/Otp/index.js b/src/screens/Otp/index.js index e96362e..1f55cd6 100644 --- a/src/screens/Otp/index.js +++ b/src/screens/Otp/index.js @@ -152,7 +152,7 @@ function Otp(props) { useEffect(() => { if (props.isLogin) { - props.navigation.navigate("Root"); + // props.navigation.navigate("Root"); } }, [props.isLogin]); @@ -215,7 +215,7 @@ function Otp(props) { fontFamily: "demi", }} > - {' ' + props.route.params?.phone || "09123456789" + ' '} + {' ' + (props.route.params?.phone || "") + ' '} {" "} ارسال شد. آن را در قسمت زیر وارد کنید. diff --git a/src/screens/Products/components/Header.js b/src/screens/Products/components/Header.js index bf88f95..77df7b7 100644 --- a/src/screens/Products/components/Header.js +++ b/src/screens/Products/components/Header.js @@ -1,6 +1,5 @@ import { View, Text } from "react-native"; import React from "react"; -import _ from "lodash"; import { connect } from "react-redux"; import { book } from "../../../redux/actions"; diff --git a/src/screens/Profile/components/User.js b/src/screens/Profile/components/User.js index 564257c..e498d67 100644 --- a/src/screens/Profile/components/User.js +++ b/src/screens/Profile/components/User.js @@ -1,9 +1,10 @@ -import { View, Text, Image, Platform, Pressable } from "react-native"; +import { View, Text, Image, Platform, Pressable, BackHandler } from "react-native"; import React from "react"; import { connect } from "react-redux"; import {user} from "../../../redux/actions"; import Svg, { Path } from "react-native-svg"; import { asyncAwesomeAlert } from "../../../utils/AsyncWrappers"; +import { useNavigation } from "@react-navigation/native"; //style import tw from "tailwind-rn"; @@ -14,6 +15,14 @@ const ios = Platform.OS === "ios"; const User = ({ user, mobile, theme, logout }) => { const [dropdown, setDropdown] = React.useState(true); + const navigation = useNavigation(); + + React.useEffect(() => { + if(!user){ + navigation.navigate('Login'); + } + },[user]); + return (