reza fixed login

master
Reza_ashrafi 2 years ago
parent f82165c9dd
commit aad59e00f5
  1. 5
      src/components/Drawer.js
  2. 3
      src/screens/Activation/index.js
  3. 6
      src/screens/Home/index.js
  4. 2
      src/screens/Login/index.js
  5. 10
      src/screens/Otp/index.js
  6. 10
      src/screens/QR/layouts/Scan/index.js
  7. 2
      src/screens/Rules/index.js

@ -232,7 +232,10 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
), ),
{}, {},
]} ]}
onPress={() => navigation.navigate(route.route)} onPress={() => {
navigation.push(route.route);
setBoxPosition();
}}
> >
{route.icon} {route.icon}
<Text <Text

@ -34,7 +34,6 @@ const ios = Platform.OS === "ios";
const { height } = Dimensions.get("window"); const { height } = Dimensions.get("window");
function Activation({ add, mobile, theme, route }) { function Activation({ add, mobile, theme, route }) {
const {data} = route.params;
const [value, setValue] = useState(null); const [value, setValue] = useState(null);
const navigation = useNavigation(); const navigation = useNavigation();
@ -103,7 +102,7 @@ function Activation({ add, mobile, theme, route }) {
fontFamily: "light", fontFamily: "light",
}, },
]} ]}
value={value || data} value={value || route?.params?.data}
onChange={(name, value) => setValue(value)} onChange={(name, value) => setValue(value)}
/> />
<CustomPressable <CustomPressable

@ -27,7 +27,7 @@ import Header from "./components/Header";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
// Within your render function // Within your render function
const Home = ({ blogs, books, userProducts, mobile }) => { const Home = ({ route, blogs, books, userProducts, mobile }) => {
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
const navigation = useNavigation(); const navigation = useNavigation();
@ -36,6 +36,10 @@ const Home = ({ blogs, books, userProducts, mobile }) => {
setPosition(position === "100%" ? "0%" : "100%"); setPosition(position === "100%" ? "0%" : "100%");
}; };
useEffect(() => {
console.log('route has been changed');
},[route]);
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{

@ -69,7 +69,7 @@ function Login(props) {
xmlnsXlink="http://www.w3.org/1999/xlink" xmlnsXlink="http://www.w3.org/1999/xlink"
width={58.644} width={58.644}
height={86.908} height={86.908}
style={{ transform: [{ translateY: -height / 10 }] }} style={{ transform: [{ translateY: -height / 20 }] }}
> >
<Defs> <Defs>
<Pattern <Pattern

@ -131,15 +131,15 @@ function Otp(props) {
const minute = value % 60; const minute = value % 60;
const hour = Math.floor(value / 60); const hour = Math.floor(value / 60);
return ( return (
(hour > 0 (minute > 0
? (minute.toString().length === 1 ? (minute.toString().length === 1
? "0" + minute.toString() ? "0" + minute.toString()
: minute) + "" : minute) + ""
: "") + : "00") +
" " + " " +
":" + ":" +
" " + " " +
(hour.toString().length === 1 ? "0" + hour.toString() : hour) (hour > 0 ? hour.toString().length === 1 ? "0" + hour.toString() : hour : "00")
); );
}, },
[props.route] [props.route]
@ -147,7 +147,7 @@ function Otp(props) {
const submitCellphone = React.useCallback(() => { const submitCellphone = React.useCallback(() => {
setTimeEnd(false); setTimeEnd(false);
setTime(120); setTime(60);
setFirstCode(""); setFirstCode("");
setSecondCode(""); setSecondCode("");
setThirdCode(""); setThirdCode("");
@ -181,7 +181,7 @@ function Otp(props) {
xmlnsXlink="http://www.w3.org/1999/xlink" xmlnsXlink="http://www.w3.org/1999/xlink"
width={58.644} width={58.644}
height={86.908} height={86.908}
style={{ transform: [{ translateY: -height / 10 }] }} style={{ transform: [{ translateY: -height / 20 }] }}
> >
<Defs> <Defs>
<Pattern <Pattern

@ -21,7 +21,6 @@ const { width, height } = Dimensions.get("screen");
import laptopImage from "../../assets/laptop.png"; import laptopImage from "../../assets/laptop.png";
function Scan({ theme, route }) { function Scan({ theme, route }) {
const { page } = route.params;
const navigation = useNavigation(); const navigation = useNavigation();
const [hasPermission, setHasPermission] = React.useState(null); const [hasPermission, setHasPermission] = React.useState(null);
const [scanned, setScanned] = React.useState(false); const [scanned, setScanned] = React.useState(false);
@ -36,7 +35,7 @@ function Scan({ theme, route }) {
const handleBarCodeScanned = React.useCallback( const handleBarCodeScanned = React.useCallback(
({ type, data }) => { ({ type, data }) => {
setScanned(true); setScanned(true);
if (page === "activation") { if (route?.params?.page === "activation") {
navigation.push("QRContent", { data }); navigation.push("QRContent", { data });
}else{ }else{
navigation.push("Activation", { data }); navigation.push("Activation", { data });
@ -45,13 +44,6 @@ function Scan({ theme, route }) {
[route, scanned] [route, scanned]
); );
if (hasPermission === null) {
return <Text>Requesting for camera permission</Text>;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
}
return ( return (
<ImageBackground <ImageBackground
source={laptopImage} source={laptopImage}

@ -124,7 +124,7 @@ const Switch = ({ theme, active, setActive }) => {
tw("flex-1 py-3 flex flex-row justify-center"), tw("flex-1 py-3 flex flex-row justify-center"),
{ {
backgroundColor: active backgroundColor: active
? Colors.theme1[theme].blueFF1 ? Colors.theme1[theme].green79 + '11'
: "transparent", : "transparent",
}, },
]} ]}

Loading…
Cancel
Save