update login

This commit is contained in:
Gugus Darmayanto 2024-09-26 11:56:15 +07:00
parent 0fb7f14a82
commit 8ec26154c0
6 changed files with 111 additions and 129 deletions

View File

@ -6,6 +6,7 @@ import { RootStackParamList } from '../../types';
import AsyncStorage from '@react-native-async-storage/async-storage'; import AsyncStorage from '@react-native-async-storage/async-storage';
import { DB } from '@/components/lib/db'; import { DB } from '@/components/lib/db';
import { GestureHandlerRootView, ScrollView } from 'react-native-gesture-handler'; import { GestureHandlerRootView, ScrollView } from 'react-native-gesture-handler';
import config from '../../components/data/config.json';
const LoginScreen = () => { const LoginScreen = () => {
const navigation = useNavigation<NavigationProp<RootStackParamList>>(); const navigation = useNavigation<NavigationProp<RootStackParamList>>();
@ -41,51 +42,49 @@ const LoginScreen = () => {
return ( return (
<> <>
<GestureHandlerRootView> <GestureHandlerRootView>
<ScrollView> <ScrollView style={{backgroundColor:"white"}}>
<View style={{ flex: 1, backgroundColor:'#2563eb'}}> <View style={{ flex: 1, backgroundColor:'white'}}>
<View style={{ <View style={{
flexDirection:"column" flexDirection: "row"
, height:300 , height: 140
, justifyContent:"center" , alignItems: "flex-end"
, alignItems:"center" , paddingHorizontal: 30
, marginBottom: 20
}}> }}>
<View style={{ flex: 1 }}>
</View>
<View style={{ <View style={{
width:"auto", width: "auto",
backgroundColor:"white", backgroundColor: "white",
padding: 10, padding: 10,
borderRadius: 20 borderRadius: 20
}}> }}>
<Image <Image
source={require('../../assets/images/logo.png')} source={require('../../assets/images/login/logo.png')}
style={{ style={{
width: 75 width: 60
, height: 75 , height: 60
}} }}
resizeMode="contain" // You can adjust this based on how you want the image to scale resizeMode="contain" // You can adjust this based on how you want the image to scale
/> />
</View> </View>
<Text style={{
color:"white",
paddingVertical: 10,
fontWeight:"bold",
fontSize: 30
}}>S.O.R.T</Text>
</View> </View>
<View style={[styles.container]}> <View style={[styles.container]}>
<View style={{marginBottom:40}}>
<Text style={{ <Text style={{
textAlign:"center" fontSize:20
, fontSize:50
, fontWeight:'bold' , fontWeight:'bold'
, color:"#2563eb" , color:config.color.textbiru
}}>Login</Text> }}>Hi !</Text>
<Text style={{ <Text style={{
textAlign:"center" fontSize:20
, fontSize:18
, fontWeight:'bold' , fontWeight:'bold'
, color:"#777" , marginVertical:5
, marginVertical:20 , color: config.color.textbiru
}}>Silahkan login ke akun anda</Text> }}>Selamat datang kembali,</Text>
<Text style={{ </View>
{/* <Text style={{
textAlign:"left" textAlign:"left"
, fontSize:18 , fontSize:18
, fontWeight:'bold' , fontWeight:'bold'
@ -93,14 +92,14 @@ const LoginScreen = () => {
, marginTop:10 , marginTop:10
, marginBottom: 10 , marginBottom: 10
,width:'100%' ,width:'100%'
}}>EMAIL</Text> }}>EMAIL</Text> */}
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="youremail@gmail.com" placeholder="youremail@gmail.com"
value={username} value={username}
onChangeText={setUsername} onChangeText={setUsername}
/> />
<Text style={{ {/* <Text style={{
textAlign: "left" textAlign: "left"
, fontSize: 18 , fontSize: 18
, fontWeight: 'bold' , fontWeight: 'bold'
@ -108,7 +107,7 @@ const LoginScreen = () => {
, marginBottom: 10 , marginBottom: 10
, marginTop: 10 , marginTop: 10
, width: '100%' , width: '100%'
}}>PASSWORD</Text> }}>PASSWORD</Text> */}
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="******" placeholder="******"
@ -116,15 +115,27 @@ const LoginScreen = () => {
onChangeText={setPassword} onChangeText={setPassword}
secureTextEntry secureTextEntry
/> />
<TouchableOpacity style={styles.button} onPress={handleLogin}> <View style={{
<Text style={styles.buttonText}>Log In</Text> flexDirection:"row",
</TouchableOpacity> marginBottom:50
}}>
<View style={{flex:1}}>
</View>
<TouchableOpacity onPress={handleForgotPassword}> <TouchableOpacity onPress={handleForgotPassword}>
<Text style={styles.forgotPasswordText}>Lupa Password?</Text> <Text style={styles.forgotPasswordText}>Lupa Password?</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{flexDirection:"row"}}> </View>
<TouchableOpacity style={styles.button} onPress={handleLogin}>
<Text style={styles.buttonText}>LOGIN</Text>
</TouchableOpacity>
<View style={{
flexDirection:"row"
, justifyContent:"center"
, marginTop: 30
}}>
<Text>Belum memiliki akun?</Text> <Text>Belum memiliki akun?</Text>
<TouchableOpacity onPress={handleSignUp} style={{marginHorizontal:5}}> <TouchableOpacity onPress={handleSignUp} style={{marginHorizontal:10}}>
<Text style={{ <Text style={{
color:"blue", color:"blue",
fontWeight:"bold" fontWeight:"bold"
@ -146,11 +157,9 @@ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
paddingVertical:50, paddingVertical:50,
borderTopRightRadius:80,
backgroundColor: 'white', backgroundColor: 'white',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', paddingHorizontal: 50
paddingHorizontal: 60
}, },
appName: { appName: {
fontSize: 36, fontSize: 36,
@ -165,8 +174,8 @@ const styles = StyleSheet.create({
}, },
input: { input: {
width: '100%', width: '100%',
borderWidth: 2, borderBottomWidth: 2,
borderColor:"#333", borderBottomColor: config.color.line,
borderRadius: 10, borderRadius: 10,
padding: 15, padding: 15,
shadowColor: "#000", shadowColor: "#000",
@ -176,7 +185,7 @@ const styles = StyleSheet.create({
button: { button: {
backgroundColor: '#2563eb', backgroundColor: '#2563eb',
padding: 15, padding: 15,
borderRadius: 10, borderRadius: 30,
width: '100%', width: '100%',
alignItems: 'center', alignItems: 'center',
marginBottom: 10, marginBottom: 10,
@ -186,14 +195,15 @@ const styles = StyleSheet.create({
borderColor: '#fff', borderColor: '#fff',
}, },
buttonText: { buttonText: {
fontSize: 18, fontSize: 20,
color: 'white', color: 'white',
fontWeight:"bold"
}, },
buttonTextSecondary: { buttonTextSecondary: {
color: '#fff', color: '#fff',
}, },
forgotPasswordText: { forgotPasswordText: {
color: '#777', color: "#0f48a1",
fontSize: 16, fontSize: 16,
marginBottom: 20, marginBottom: 20,
textDecorationLine: 'underline', textDecorationLine: 'underline',

View File

@ -107,15 +107,18 @@ VALUES (
<InfoLayer info={setInfo} navigation={navigation} /> <InfoLayer info={setInfo} navigation={navigation} />
</> </>
: :
<View style={{ flex: 1, backgroundColor: config.color.primary }}> <View style={{ flex: 1, backgroundColor: 'white'}}>
<GestureHandlerRootView> <GestureHandlerRootView>
<ScrollView> <ScrollView>
<View style={{ <View style={{
flexDirection: "column" flexDirection: "row"
, height: 300 , height: 140
, justifyContent: "center" , alignItems: "flex-end"
, alignItems: "center" , paddingHorizontal: 30
}}> }}>
<View style={{ flex: 1 }}>
</View>
<View style={{ <View style={{
width: "auto", width: "auto",
backgroundColor: "white", backgroundColor: "white",
@ -123,87 +126,49 @@ VALUES (
borderRadius: 20 borderRadius: 20
}}> }}>
<Image <Image
source={require('../../assets/images/logo.png')} source={require('../../assets/images/login/logo.png')}
style={{ style={{
width: 75 width: 60
, height: 75 , height: 60
}} }}
resizeMode="contain" // You can adjust this based on how you want the image to scale resizeMode="contain" // You can adjust this based on how you want the image to scale
/> />
</View> </View>
<Text style={{
color: "white",
paddingVertical: 10,
fontWeight: "bold",
fontSize: 30
}}>S.O.R.T</Text>
</View> </View>
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.title}>Register</Text> <Text style={styles.title}>Buat Akun Baru</Text>
<Text style={{
textAlign: "left"
, fontSize: 18
, fontWeight: 'bold'
, color: "#777"
, marginTop: 10
, width: '100%'
}}>{(`nama lengkap`).toUpperCase()}</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="Nama Anda" placeholder="Nama Anda"
value={fullname} value={fullname}
onChangeText={setFullname} onChangeText={setFullname}
/> />
<Text style={{
textAlign: "left"
, fontSize: 18
, fontWeight: 'bold'
, color: "#777"
, width: '100%'
}}>{(`email`).toUpperCase()}</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="emailanda@gmail.com" placeholder="Email"
value={username} value={username}
onChangeText={setUsername} onChangeText={setUsername}
/> />
<Text style={{
textAlign: "left"
, fontSize: 18
, fontWeight: 'bold'
, color: "#777"
, width: '100%'
}}>{(`no. telepon`).toUpperCase()}</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="No. Telepon Anda" placeholder="No. Telepon Anda"
value={phone} value={phone}
onChangeText={setPhone} onChangeText={setPhone}
/> />
<Text style={{
textAlign: "left"
, fontSize: 18
, fontWeight: 'bold'
, color: "#777"
, width: '100%'
}}>{(`PASSWORD`).toUpperCase()}</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="******" placeholder="Password"
value={password} value={password}
onChangeText={setPassword} onChangeText={setPassword}
secureTextEntry secureTextEntry
/> />
<Text style={{
textAlign: "left"
, fontSize: 18
, fontWeight: 'bold'
, color: "#777"
, width: '100%'
}}>{(`konfirmasi password`).toUpperCase()}</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder="******" placeholder="Konfirmasi Password"
value={passwordRepeat} value={passwordRepeat}
onChangeText={setPasswordRepeat} onChangeText={setPasswordRepeat}
secureTextEntry secureTextEntry
@ -212,7 +177,9 @@ VALUES (
<Text style={styles.buttonText}>{(`Register`).toUpperCase()}</Text> <Text style={styles.buttonText}>{(`Register`).toUpperCase()}</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{ marginBottom:30, marginTop:20, flexDirection: "row" }}> <View style={{ marginBottom:30, marginTop:20, flexDirection: "row" }}>
<View style={{ flex: 1 }}>
<Text>Sudah memiliki akun?</Text> <Text>Sudah memiliki akun?</Text>
</View>
<TouchableOpacity onPress={handleSignIn} style={{ marginHorizontal: 5 }}> <TouchableOpacity onPress={handleSignIn} style={{ marginHorizontal: 5 }}>
<Text style={{ <Text style={{
color: "blue", color: "blue",
@ -234,8 +201,7 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', paddingVertical: 10,
paddingVertical: 20,
paddingHorizontal:40, paddingHorizontal:40,
borderTopLeftRadius: 50 borderTopLeftRadius: 50
}, },
@ -246,27 +212,29 @@ const styles = StyleSheet.create({
marginBottom: 10, marginBottom: 10,
}, },
title: { title: {
fontSize: 40, fontSize: 20,
color: config.color.primary, color: config.color.primary,
marginBottom: 20, fontWeight:"bold",
fontWeight:"bold" marginBottom:30
}, },
input: { input: {
width: '100%', width: '100%',
backgroundColor: '#fff', borderBottomWidth: 2,
borderWidth:1, borderBottomColor: config.color.line,
borderRadius: 10, borderRadius: 10,
padding: 15, padding: 15,
shadowColor: "#000",
marginBottom: 20, marginBottom: 20,
fontSize: 16, fontSize: 16,
}, },
button: { button: {
backgroundColor: config.color.primary, backgroundColor: config.color.primary,
padding: 15, padding: 15,
borderRadius: 10, borderRadius: 50,
width: '100%', width: '100%',
alignItems: 'center', alignItems: 'center',
marginBottom: 10, marginBottom: 30,
marginTop: 30,
}, },
buttonSecondary: { buttonSecondary: {
backgroundColor: 'transparent', backgroundColor: 'transparent',

BIN
assets/images/login/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/images/login/bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

View File

@ -1,6 +1,10 @@
{ {
"color":{ "color":{
"primary": "#2563eb" "primary": "#2563eb",
"line" : "#96aeda",
"textbiru" : "#2362e5",
"logohijau" : "#60e1f6",
"logobiru" : "#2563ea"
}, },
"api" : "http://193.203.167.219:8282/data/query/odoo" "api" : "http://193.203.167.219:8282/data/query/odoo"
,"api2" : "https://app.rumahjo.com/data/query/odoo" ,"api2" : "https://app.rumahjo.com/data/query/odoo"