Skip to content

Commit

Permalink
Add style in login
Browse files Browse the repository at this point in the history
  • Loading branch information
Loule95450 committed Feb 28, 2024
1 parent dc62a0d commit 7f3be86
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 50 deletions.
68 changes: 68 additions & 0 deletions src/screens/login/LoginScreen.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import {StyleSheet} from 'react-native';

export const styles = StyleSheet.create({
safeAreaView: {
justifyContent: 'center',
alignItems: 'center',
},
image: {
width: 200,
height: 200,
},
text: {
fontSize: 24,
fontWeight: 'bold',
},
view: {
flex: 3,
alignItems: 'center',
justifyContent: 'space-evenly',
backgroundColor: '#BB93E5',
borderTopLeftRadius: 30,
borderTopRightRadius: 30,
marginTop: 20,
},
innerView: {
width: '80%',
},
textInput: {
borderWidth: 1,
padding: 10,
borderRadius: 10,
borderColor: 'grey',
},
passwordInput: {
borderWidth: 1,
padding: 10,
marginTop: 10,
borderRadius: 10,
borderColor: 'grey',
color: 'black',
},
buttonView: {
marginTop: 10,
},
row: {
flexDirection: 'row',
justifyContent: 'space-between',
},
leftText: {
textAlign: 'left',
width: '50%',
},
rightText: {
textAlign: 'right',
width: '50%',
},
button: {
backgroundColor: 'white',
padding: 10,
borderRadius: 10,
marginTop: 50,
alignItems: 'center',
width: '80%',
},
buttonText: {
fontSize: 18,
},
});
71 changes: 21 additions & 50 deletions src/screens/login/LoginScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,79 +1,50 @@
import React from 'react';
import {
Button,
Image,
SafeAreaView,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import {styles} from './LoginScreen.styles.ts';

const LoginScreen = () => {
return (
<SafeAreaView style={styles.screen}>
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<>
<SafeAreaView style={styles.safeAreaView}>
<Image
source={require('../../../assets/kayu.png')}
style={{width: 200, height: 200}}
style={styles.image}
/>
<Text style={{fontSize: 24, fontWeight: 'bold'}}>
Welcome back to Kayu
</Text>
</View>
<View
style={{
flex: 3,
alignItems: 'center',
justifyContent: 'space-evenly',
}}>
<Text style={{fontSize: 24, fontWeight: 'bold'}}>Login</Text>

<View style={{width: '80%'}}>
<Text style={styles.text}>Welcome back to Kayu</Text>
</SafeAreaView>
<View style={styles.view}>
<View style={styles.innerView}>
<View>
<TextInput
placeholder="Email"
style={{
borderWidth: 1,
padding: 10,
borderRadius: 10,
borderColor: 'grey',
}}
textContentType={'emailAddress'}
style={styles.textInput}
/>
<TextInput
placeholder="Password"
style={{
borderWidth: 1,
padding: 10,
marginTop: 10,
borderRadius: 10,
borderColor: 'grey',
}}
textContentType={'password'}
style={styles.passwordInput}
/>
</View>
<View style={{width: '80%', marginTop: 10}}>
<View
style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={{textAlign: 'left', width: '50%'}}>
Forgot Password?
</Text>
<Text style={{textAlign: 'right', width: '50%'}}>
You don't have an account?
</Text>
<View style={styles.buttonView}>
<View style={styles.row}>
<Text style={styles.leftText}>Forgot Password?</Text>
<Text style={styles.rightText}>You don't have an account?</Text>
</View>
<Button title="Login" />
</View>
</View>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>Login</Text>
</TouchableOpacity>
</View>
</SafeAreaView>
</>
);
};

const styles = StyleSheet.create({
screen: {
flex: 1,
backgroundColor: 'white',
},
});

export default LoginScreen;

0 comments on commit 7f3be86

Please sign in to comment.