reza fixed login

master
Reza_ashrafi 3 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}
<Text

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

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

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

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

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

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

Loading…
Cancel
Save