upd: claude
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import AuthProvider from '@/providers/AuthProvider';
|
||||
import ThemeProvider, { useTheme } from '@/providers/ThemeProvider';
|
||||
import QueryProvider from '@/providers/QueryProvider';
|
||||
import ErrorBoundary from '@/components/ErrorBoundary';
|
||||
import { useFonts } from 'expo-font';
|
||||
import { Stack } from 'expo-router';
|
||||
import * as SplashScreen from 'expo-splash-screen';
|
||||
@@ -22,7 +23,6 @@ function AppStack() {
|
||||
<>
|
||||
<Stack screenOptions={{ contentStyle: { backgroundColor: colors.header } }}>
|
||||
<Stack.Screen name="index" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="verification" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
||||
</Stack>
|
||||
<StatusBar style="auto" />
|
||||
@@ -47,15 +47,17 @@ export default function RootLayout() {
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView style={Styles.flex1}>
|
||||
<NotifierWrapper>
|
||||
<ThemeProvider>
|
||||
<QueryProvider>
|
||||
<AuthProvider>
|
||||
<AppStack />
|
||||
</AuthProvider>
|
||||
</QueryProvider>
|
||||
</ThemeProvider>
|
||||
</NotifierWrapper>
|
||||
<ErrorBoundary>
|
||||
<NotifierWrapper>
|
||||
<ThemeProvider>
|
||||
<QueryProvider>
|
||||
<AuthProvider>
|
||||
<AppStack />
|
||||
</AuthProvider>
|
||||
</QueryProvider>
|
||||
</ThemeProvider>
|
||||
</NotifierWrapper>
|
||||
</ErrorBoundary>
|
||||
</GestureHandlerRootView>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
import { ButtonForm } from "@/components/buttonForm";
|
||||
import Text from '@/components/Text';
|
||||
import { ConstEnv } from "@/constants/ConstEnv";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import CryptoES from "crypto-es";
|
||||
import React, { useState } from "react";
|
||||
import { Image, View } from "react-native";
|
||||
import { CodeField, Cursor, useBlurOnFulfill, useClearByFocusCell, } from 'react-native-confirmation-code-field';
|
||||
|
||||
export default function Index() {
|
||||
const [value, setValue] = useState('');
|
||||
const ref = useBlurOnFulfill({ value, cellCount: 4 });
|
||||
const [props, getCellOnLayoutHandler] = useClearByFocusCell({
|
||||
value,
|
||||
setValue,
|
||||
});
|
||||
const { colors } = useTheme();
|
||||
|
||||
const { signIn } = useAuthSession();
|
||||
const login = (): void => {
|
||||
// WARNING: This is a hardcoded bypass for development purposes.
|
||||
// It should be removed or secured before production release.
|
||||
if (__DEV__) {
|
||||
const random: string = 'contohLoginMobileDarmasaba';
|
||||
var mytexttoEncryption = "contohLoginMobileDarmasaba"
|
||||
const encrypted = CryptoES.AES.encrypt(mytexttoEncryption, ConstEnv.pass_encrypt).toString();
|
||||
signIn(encrypted);
|
||||
} else {
|
||||
console.warn("Bypass login disabled in production.");
|
||||
}
|
||||
}
|
||||
return (
|
||||
<View style={[Styles.wrapLogin, { backgroundColor: colors.background }]} >
|
||||
<View style={[Styles.rowItemsCenter, Styles.mv50]}>
|
||||
<Image
|
||||
source={require("../assets/images/logo.png")}
|
||||
style={[{ width: 300, height: 150 }]}
|
||||
width={270}
|
||||
height={110}
|
||||
/>
|
||||
{/* <Text style={[Styles.textSubtitle]}>PERBEKEL DARMASABA</Text> */}
|
||||
</View>
|
||||
<View style={[Styles.mb30]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Verifikasi Nomor Telepon</Text>
|
||||
<Text style={[Styles.textMediumNormal]}>Masukkan kode yang kami kirimkan melalui WhatsApp</Text>
|
||||
<Text style={[Styles.textMediumSemiBold]}>+628980185458</Text>
|
||||
</View>
|
||||
<CodeField
|
||||
ref={ref}
|
||||
{...props}
|
||||
value={value}
|
||||
rootStyle={{ width: '80%', alignSelf: 'center' }}
|
||||
onChangeText={setValue}
|
||||
cellCount={4}
|
||||
keyboardType="number-pad"
|
||||
renderCell={({ index, symbol, isFocused }) => (
|
||||
<Text
|
||||
key={index}
|
||||
style={[Styles.verificationCell, isFocused && Styles.verificationFocusCell, { borderColor: isFocused ? colors.tint : colors.icon, color: colors.text }]}
|
||||
onLayout={getCellOnLayoutHandler(index)}>
|
||||
{symbol || (isFocused ? <Cursor /> : null)}
|
||||
</Text>
|
||||
)}
|
||||
/>
|
||||
<ButtonForm
|
||||
text="SUBMIT"
|
||||
// onPress={() => { router.push("/home") }}
|
||||
onPress={login}
|
||||
/>
|
||||
<Text style={[Styles.textInformation, Styles.mt05, Styles.cDefault, { textAlign: 'center', color: colors.tint }]}>
|
||||
Tidak Menerima kode verifikasi? Kirim Ulang
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user