created buttons component & created login header bar

This commit is contained in:
ue 2018-09-26 23:15:42 +03:00
parent 0addf95020
commit ed38404414
6 changed files with 80 additions and 13 deletions

View File

@ -0,0 +1,3 @@
import GreetingHeaderButton from "./views/greetingHeaderButtonView";
export { GreetingHeaderButton };

View File

@ -0,0 +1,13 @@
import EStyleSheet from "react-native-extended-stylesheet";
export default EStyleSheet.create({
button: {
width: 54,
backgroundColor: "transparent",
height: 19,
},
buttonText: {
color: "#c1c5c7",
fontSize: 16,
},
});

View File

@ -0,0 +1,17 @@
import React, { Fragment } from "react";
import { TouchableWithoutFeedback, Text } from "react-native";
import styles from "./greetingHeaderButtonStyles";
const GreetingHeaderButtonView = ({ text, onPress, style }) => (
<Fragment>
<TouchableWithoutFeedback
style={[styles.button, style]}
onPress={() => onPress && onPress()}
>
<Text style={styles.buttonText}>{text}</Text>
</TouchableWithoutFeedback>
</Fragment>
);
export default GreetingHeaderButtonView;

View File

@ -1,12 +1,16 @@
import EStyleSheet from "react-native-extended-stylesheet";
export default EStyleSheet.create({
wrapper: {
container: {
flex: 1,
flexDirection: "column",
height: "$deviceHeight / 3",
},
body: {
flexDirection: "row",
maxHeight: "$deviceHeight / 3",
overflow: "hidden",
backgroundColor: "#ffffff",
backgroundColor: "$white",
},
description: {
textAlignVertical: "center",
@ -31,7 +35,24 @@ export default EStyleSheet.create({
flex: 0.4,
alignSelf: "center",
height: 100,
marginTop: 20,
left: 20,
marginTop: 50,
marginLeft: 32,
},
headerRow: {
width: "$deviceWidth",
flexDirection: "row",
height: 55,
justifyContent: "space-between",
},
logo: {
width: 32,
height: 32,
marginLeft: 32,
alignSelf: "center",
},
headerButton: {
margin: 10,
marginRight: 19,
alignSelf: "center",
},
});

View File

@ -3,7 +3,7 @@ import { View, Text, Image } from "react-native";
// Constants
// Components
import { GreetingHeaderButton } from "../../buttons";
// Styles
// eslint-disable-next-line
import styles from "./loginHeaderStyles";
@ -28,16 +28,27 @@ class LoginHeaderView extends Component {
const { description, title } = this.props;
return (
<View style={styles.wrapper}>
<View style={styles.titleText}>
<Text style={styles.title}>{title}</Text>
<Text style={styles.description}>{description}</Text>
</View>
<View style={{ flex: 0.7 }}>
<View styles={styles.container}>
<View style={styles.headerRow}>
<Image
style={styles.mascot}
source={require("../../../assets/love_mascot.png")}
style={styles.logo}
source={require("../../../assets/esteem.png")}
/>
<View style={styles.headerButton}>
<GreetingHeaderButton text="Sign up" />
</View>
</View>
<View style={styles.body}>
<View style={styles.titleText}>
<Text style={styles.title}>{title}</Text>
<Text style={styles.description}>{description}</Text>
</View>
<View style={{ flex: 0.7 }}>
<Image
style={styles.mascot}
source={require("../../../assets/love_mascot.png")}
/>
</View>
</View>
</View>
);

View File

@ -8,6 +8,7 @@ import {
TextInput,
BackHandler,
Linking,
StatusBar,
} from "react-native";
import { Navigation } from "react-native-navigation";
@ -154,6 +155,7 @@ class LoginScreen extends Component {
render() {
return (
<View style={{ flex: 1 }}>
<StatusBar hidden translucent />
<LoginHeader
title="Sign in"
description="To get all the benefits using eSteem"