Commit 8b3c48f3 by Prachpawee

update style

parent cbe32519
import React from 'react';
import { View, Card, CardItem, Thumbnail } from 'native-base';
import { StyleSheet } from 'react-native';
const CardWithThumbnail = props => {
return (
<View style={styles.container}>
<Card style={styles.cardContainer}>
<CardItem>
<Thumbnail
style={styles.avatarImg}
source={{
uri: 'https://www.logistec.com/wp-content/uploads/2017/12/placeholder.png',
}}
/>
</CardItem>
{props.children}
</Card>
</View>
);
};
const styles = StyleSheet.create({
container: {
top: '20%',
alignItems: 'center',
},
cardContainer: {
alignItems: 'center',
justifyContent: 'center',
width: '90%',
paddingHorizontal: 30,
paddingVertical: 40,
borderRadius: 10,
},
avatarImg: {
width: 140,
height: 140,
borderRadius: 100,
},
});
export default CardWithThumbnail;
import React from 'react';
import { View, Text, Card, Button } from 'native-base';
import { StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
alignItems: 'center',
top: '10%',
},
cardStyle: {
width: '90%',
marginTop: 40,
borderRadius: 10,
paddingHorizontal: 20,
paddingTop: 20,
paddingBottom: 50,
},
submitBtn: { borderRadius: 30, marginTop: 30 },
});
const LoginCard = props => {
return (
<View style={styles.container}>
<Text style={{ fontSize: 36 }}>{props.title}</Text>
<Card style={styles.cardStyle}>
{props.children}
<Button danger full style={styles.submitBtn} onPress={props.continue}>
<Text>CONTINUE</Text>
</Button>
</Card>
{props.isLogin ? (
<Text style={{ color: 'grey', marginTop: 20 }}>
Don't have an account?{' '}
<Text style={{ color: 'firebrick' }} onPress={() => console.log('Register!')}>
Register
</Text>
</Text>
) : (
<View />
)}
</View>
);
};
export default LoginCard;
import React from 'react';
import { View, Body, Title } from 'native-base';
import { StyleSheet } from 'react-native';
const resetPassBg = props => {
return (
<View style={{height: '100%'}}>
<View style={styles.TopBg}>
<Body>
<Title style={styles.title}>{props.title}</Title>
</Body>
</View>
{props.children}
<View style={styles.BotBg} />
</View>
);
};
const styles = StyleSheet.create({
TopBg: {
backgroundColor: '#b72929',
height: 250,
width: '100%',
position: 'absolute',
top: 0,
},
title: {
top: '25%',
fontSize: 36,
},
BotBg: {
position: 'absolute',
bottom: 0,
backgroundColor: '#b72929',
height: 50,
width: '100%',
},
});
export default resetPassBg;
import React from 'react'; import React, { Component } from 'react';
import { View, Text } from 'native-base'; import { Modal, Image, StyleSheet } from 'react-native';
import { Modal, TouchableHighlight } from 'react-native'; import { View, Button, Text, H1 } from 'native-base';
const SuccessModal = props => { export default class SuccessModal extends Component {
return ( constructor(props) {
<Modal super(props);
animationType="slide" this.state = {
transparent={false} modalVisible: false,
visible={this.state.modalVisible} };
onRequestClose={() => { }
Alert.alert('Modal has been closed.'); setModalVisible(visible) {
}}> this.setState({ modalVisible: visible });
<View style={{ marginTop: 22 }}> }
<View>
<Text>Hello World!</Text>
<TouchableHighlight render() {
const styles = StyleSheet.create({
dimBg: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0,0,0,0.5)',
},
modalContainer: {
backgroundColor: 'white',
width: '90%',
borderRadius: 10,
paddingHorizontal: 20,
paddingBottom: 40,
paddingTop: 60,
alignItems: 'center',
},
img: {
width: 90,
height: 90,
},
textContainer: {
alignItems: 'center',
marginTop: 20,
marginBottom: 40,
},
btnStyle: {
borderRadius: 30,
marginTop: 30,
},
});
return (
<View>
<Modal animationType="fade" transparent={true} visible={this.state.modalVisible}>
<View style={styles.dimBg}>
<View style={styles.modalContainer}>
<Image
style={styles.img}
source={{
uri: 'https://www.stickpng.com/assets/images/5aa78e387603fc558cffbf1d.png',
}}
/>
<View style={styles.textContainer}>
<H1>Success!</H1>
<Text style={{ color: '#cacaca', marginTop: 10 }}>Thansdfgksjdfo;gjs;dfjsdfgsdfg</Text>
<Text style={{ color: '#cacaca' }}>Thansdfgksjdfo;gjs;dfjsdfgsdfg</Text>
</View>
<Button
full
danger
onPress={() => {
this.setModalVisible(!this.state.modalVisible);
console.log('hide modal!');
}}
style={{ borderRadius: 40 }}
>
<Text>GO TO HOME</Text>
</Button>
</View>
</View>
</Modal>
{this.props.isRegister ? (
<Button
danger
full
style={styles.btnStyle}
onPress={() => { onPress={() => {
this.setModalVisible(!this.state.modalVisible); this.setModalVisible(true);
}}> }}
<Text>Hide Modal</Text> >
</TouchableHighlight> <Text>CONTINUE</Text>
</View> </Button>
) : (
<View />
)}
</View> </View>
</Modal> );
); }
}; }
export default SuccessModal;
import { StyleSheet } from 'react-native';
export const theme = StyleSheet.create({
startContainer: { top: 120, paddingHorizontal: 50 },
startTitle: { textAlign: 'center', color: '#4a4a4a', fontSize: 36 },
startFormContainer: { paddingRight: 10, marginBottom: 10, marginTop: 40 },
redRoundedBtn: { borderRadius: 40, backgroundColor: '#f97070' },
});
import React, { Component } from 'react';
import { Container, Text, Content, Input, View, Form, Item, Button } from 'native-base';
import { theme } from '../../constants/Styles';
export default class forgotPassword extends Component {
render() {
return (
<Container>
<Content style={theme.startContainer}>
<Text style={theme.startTitle}>Forgot Password</Text>
<View style={{ paddingHorizontal: 15, marginTop: 40 }}>
<Text style={{ color: '#808080' }}>Please enter your email address.</Text>
<Text style={{ color: '#808080' }}>
You will receive a link to create a new password via email.
</Text>
</View>
<Form style={theme.startFormContainer}>
<Item>
<Input placeholder="E-mail" placeholderTextColor={'#cacaca'} style={{ color: '#808080' }} />
</Item>
</Form>
<Button full style={[theme.redRoundedBtn, { marginTop: 75 }]}>
<Text>SEND</Text>
</Button>
</Content>
</Container>
);
}
}
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Container, Text, Input, CardItem, Radio, Form, Item, Label, Left, Right } from 'native-base'; import { Container, Text, Content, Input, Radio, Form, Item, Left, Right, Button, Row } from 'native-base';
import LoginCard from '../../components/layout/LoginCard'; import { theme } from '../../constants/Styles';
export default class login extends Component { export default class login extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -10,38 +10,53 @@ export default class login extends Component { ...@@ -10,38 +10,53 @@ export default class login extends Component {
} }
render() { render() {
return ( return (
<Container style={{ backgroundColor: '#fbfbfb' }}> <Container>
<LoginCard title={'Login'} isLogin={true}> <Content style={theme.startContainer}>
<Form style={{ paddingRight: 10, marginBottom: 10 }}> <Text style={theme.startTitle}>Login</Text>
<Item floatingLabel> <Form style={theme.startFormContainer}>
<Label style={{ color: '#cacaca' }}>Username</Label> <Item>
<Input /> <Input
placeholder="Username"
placeholderTextColor={'#cacaca'}
style={{ color: '#808080' }}
/>
</Item> </Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Password</Label> <Item>
<Input secureTextEntry={true} /> <Input
secureTextEntry={true}
placeholder="Password"
placeholderTextColor={'#cacaca'}
style={{ color: '#808080' }}
/>
</Item> </Item>
</Form> </Form>
<CardItem> <Row style={{ marginTop: 30 }}>
<Left> <Left>
<Radio <Row>
color={'#cacaca'} <Radio
selected={this.state.isCheck} color={'#cacaca'}
onPress={() => selected={this.state.isCheck}
this.setState(() => { onPress={() =>
return (this.state.isCheck = !this.state.isCheck); this.setState(() => {
}) return (this.state.isCheck = !this.state.isCheck);
} })
/> }
<Text style={{ color: '#cacaca' }}>Remember me</Text> />
<Text style={{ color: '#cacaca', marginLeft: 5 }}>Remember me</Text>
</Row>
</Left> </Left>
<Right> <Right>
<Text style={{ color: '#cacaca' }} onPress={() => console.log('Forgot password!!')}> <Text style={{ color: '#cacaca' }}>Forgot password?</Text>
Forgot password
</Text>
</Right> </Right>
</CardItem> </Row>
</LoginCard> <Button full style={[theme.redRoundedBtn, { marginTop: 75 }]}>
<Text>LOGIN</Text>
</Button>
<Text style={{ color: '#4a4a4a', textAlign: 'center', marginTop: 20 }}>
Don't have an account? <Text style={{ color: '#f44c4c', fontWeight: 'bold' }}>Register</Text>
</Text>
</Content>
</Container> </Container>
); );
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Container, Text, CardItem, CheckBox, Left, Form, Input, Label, Item, View } from 'native-base'; import { Container, Text, Content, Input, Form, Item, Left, Button, Row, CheckBox } from 'native-base';
import { Modal, TouchableHighlight } from 'react-native'; import { theme } from '../../constants/Styles';
import LoginCard from '../../components/layout/LoginCard';
import SuccessModal from '../../components/layout/SuccessModal';
export default class register extends Component { export default class register extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
isCheck: false, isCheck: false,
modalVisible: false,
}; };
} }
setModalVisible(visible) {
this.setState({ modalVisible: visible });
}
render() { render() {
const InputText = props => {
return (
<Item>
<Input
placeholder={props.placeholder}
secureTextEntry={props.isPass}
placeholderTextColor={'#cacaca'}
style={{ color: '#808080' }}
/>
</Item>
);
};
return ( return (
<Container style={{ backgroundColor: '#fbfbfb' }}> <Container>
<Modal <Content style={theme.startContainer}>
animationType="fade" <Text style={theme.startTitle}>Register</Text>
transparent={true} <Form style={theme.startFormContainer}>
visible={this.state.modalVisible} <InputText placeholder={'Name'} />
onRequestClose={() => { <InputText placeholder={'Surname'} />
Alert.alert('Modal has been closed.'); <InputText placeholder={'E-mail'} />
}}> <InputText placeholder={'Password'} isPass={true} />
<View style={{ alignItems: 'center', top: '20%' }}> <InputText placeholder={'Confirm password'} isPass={true} />
<View style={{ backgroundColor: 'white', width: '90%', height: 100 }}> <InputText placeholder={'Phone number'} />
<Text>test modal</Text>
<TouchableHighlight
onPress={() => {
this.setModalVisible(!this.state.modalVisible);
}}>
<Text>Hide Modal</Text>
</TouchableHighlight>
</View>
</View>
</Modal>
<LoginCard
title={'Register'}
continue={() => {
this.setModalVisible(true);
}}>
<Form style={{ paddingRight: 10, marginBottom: 10 }}>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Name</Label>
<Input />
</Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Surname</Label>
<Input />
</Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>E-mail</Label>
<Input />
</Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Password</Label>
<Input secureTextEntry={true} />
</Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Confirm password</Label>
<Input secureTextEntry={true} />
</Item>
<Item floatingLabel>
<Label style={{ color: '#cacaca' }}>Phone no.</Label>
<Input />
</Item>
</Form> </Form>
<CardItem> <Row style={{ marginTop: 30 }}>
<Left> <Left>
<CheckBox <Row>
color={'#cacaca'} <CheckBox
checked={this.state.isCheck} color={'#888888'}
style={{ marginRight: 5 }} checked={this.state.isCheck}
onPress={() => onPress={() =>
this.setState(() => { this.setState(() => {
return (this.state.isCheck = !this.state.isCheck); return (this.state.isCheck = !this.state.isCheck);
}) })
} }
/> />
<Text style={{ color: '#cacaca' }}> <Text style={{ color: '#9ea0a5', marginLeft: 15 }}>
I have read the{' '} I have read the{' '}
<Text <Text style={{ textDecorationLine: 'underline', color: '#56575a' }}>
style={{ textDecorationLine: 'underline', color: 'grey' }} Terms and Conditions
onPress={() => console.log('Terms and Conditions')}> </Text>
Terms and Conditions .
</Text> </Text>
. </Row>
</Text>
</Left> </Left>
</CardItem> </Row>
</LoginCard> <Button full style={{ marginTop: 50, borderRadius: 40, backgroundColor: '#f97070' }}>
<Text>CONTINUE</Text>
</Button>
</Content>
</Container> </Container>
); );
} }
......
import React, { Component } from 'react';
import { Container, CardItem, Button, Text, View, Input } from 'native-base';
import ResetPassBg from '../../components/layout/ResetPassBG';
import CardWithThumbnail from '../../components/layout/CardWithThumbnail';
class resetPassword extends Component {
render() {
return (
<Container>
<ResetPassBg title={'Reset you password'}>
<CardWithThumbnail>
<CardItem>
<Input
placeholder="Your email"
underlineColorAndroid="#d8d8d8"
placeholderTextColor="#cacaca"
/>
</CardItem>
<Button rounded full danger style={{ borderRadius: 50 }}>
<Text>Send</Text>
</Button>
</CardWithThumbnail>
</ResetPassBg>
</Container>
);
}
}
export default resetPassword;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Container, Text, View, H3 } from 'native-base'; import { Container, Text, Content, View, Button } from 'native-base';
import { StyleSheet } from 'react-native'; import { Image } from 'react-native';
import ResetPassBg from '../../components/layout/ResetPassBG'; import { theme } from '../../constants/Styles';
import CardWithThumbnail from '../../components/layout/CardWithThumbnail';
const styles = StyleSheet.create({
titleText: {
textAlign: 'center',
color: '#86929d',
},
normalText: {
textAlign: 'center',
color: '#4a4a4a',
},
});
export default class sendEmail extends Component { export default class sendEmail extends Component {
render() { render() {
return ( return (
<Container> <Container>
<ResetPassBg title={'Login'}> <Content style={theme.startContainer}>
<CardWithThumbnail> <Image
<View style={{ marginTop: 20 }}> style={{ width: 135, height: 135, alignSelf: 'center', borderRadius: 100 }}
<H3 style={styles.titleText}>Reset your password</H3> source={{
</View> uri:
<View style={{ marginTop: 20 }}> 'https://constructioncompanieslebanon.com/wp-content/uploads/2018/02/6ba96ffc82c13a9c4271233ab23e9afe.jpg',
<Text style={styles.normalText}> }}
We have sent a reset password email to _________@gmail.com />
</Text> <Text style={[theme.startTitle, { marginTop: 45 }]}>Check you email</Text>
<Text style={styles.normalText}> <View style={{ paddingHorizontal: 15, marginTop: 40 }}>
Please click the reset password link to set your new password. <Text style={{ color: '#808080' }}>
</Text> We sent an email with instructions for resetting your password.
</View> </Text>
<View style={{ marginTop: 20 }}> </View>
<Text style={styles.normalText}>Didn't receive email yet?</Text> <Button full style={[theme.redRoundedBtn, { marginTop: 60 }]}>
<Text style={styles.normalText}> <Text>DONE</Text>
Please check your spam folder, or{' '} </Button>
<Text style={{ color: '#4a90e2' }} onPress={() => console.log('resend click!')}> <Button transparent style={{ marginTop: 40, alignSelf: 'center' }}>
resend <Text style={{ color: '#9b9b9b' }}>RESEND</Text>
</Text>{' '} </Button>
the email. </Content>
</Text>
</View>
</CardWithThumbnail>
</ResetPassBg>
</Container> </Container>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment