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"; import EStyleSheet from "react-native-extended-stylesheet";
export default EStyleSheet.create({ export default EStyleSheet.create({
wrapper: { container: {
flex: 1, flex: 1,
flexDirection: "column",
height: "$deviceHeight / 3",
},
body: {
flexDirection: "row", flexDirection: "row",
maxHeight: "$deviceHeight / 3", maxHeight: "$deviceHeight / 3",
overflow: "hidden", overflow: "hidden",
backgroundColor: "#ffffff", backgroundColor: "$white",
}, },
description: { description: {
textAlignVertical: "center", textAlignVertical: "center",
@ -31,7 +35,24 @@ export default EStyleSheet.create({
flex: 0.4, flex: 0.4,
alignSelf: "center", alignSelf: "center",
height: 100, height: 100,
marginTop: 20, marginTop: 50,
left: 20, 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 // Constants
// Components // Components
import { GreetingHeaderButton } from "../../buttons";
// Styles // Styles
// eslint-disable-next-line // eslint-disable-next-line
import styles from "./loginHeaderStyles"; import styles from "./loginHeaderStyles";
@ -28,7 +28,17 @@ class LoginHeaderView extends Component {
const { description, title } = this.props; const { description, title } = this.props;
return ( return (
<View style={styles.wrapper}> <View styles={styles.container}>
<View style={styles.headerRow}>
<Image
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}> <View style={styles.titleText}>
<Text style={styles.title}>{title}</Text> <Text style={styles.title}>{title}</Text>
<Text style={styles.description}>{description}</Text> <Text style={styles.description}>{description}</Text>
@ -40,6 +50,7 @@ class LoginHeaderView extends Component {
/> />
</View> </View>
</View> </View>
</View>
); );
} }
} }

View File

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