Browse Source

home screen buttons

pull/8/head
Tim Glasgow 2 years ago
parent
commit
8c2de9046a
  1. 16
      squarenotsquare/src/screens/Home.js
  2. 10
      squarenotsquare/src/screens/styles/AppStyles.js
  3. 8
      squarenotsquare/src/themes/Metrics.js

16
squarenotsquare/src/screens/Home.js

@ -2,13 +2,14 @@ import React from "react";
import { Text, View } from "react-native"; import { Text, View } from "react-native";
import { useState } from "react"; import { useState } from "react";
import { styles } from './styles/AppStyles'; import { styles } from './styles/AppStyles';
import { TouchableOpacity } from "react-native-gesture-handler";
function Home(props){ function Home(props){
return ( return (
<View style={[styles.flex]}> <View style={[styles.flex]}>
<View style={[styles.flexHalf, styles.spaceAround]}> <View style={[styles.flexHalf, styles.spaceAround]}>
<Text style={[styles.headerTitleFont, styles.centeredText, styles.darkText]}> <Text style={[styles.boldText, styles.headerTitleFont, styles.centeredText, styles.darkText]}>
Square Square
<Text style={[styles.green, styles.headerTitleFont, styles.centeredText, styles.lightText]}> <Text style={[styles.green, styles.headerTitleFont, styles.centeredText, styles.lightText]}>
{' not '} {' not '}
@ -18,10 +19,17 @@ function Home(props){
</Text> </Text>
</Text> </Text>
</View> </View>
<View style={styles.flex}> <View style={[styles.flex, styles.centeredItems, styles.spaceEvenly]}>
<Text style={[styles.largeFont, styles.centeredText, styles.darkText]}> <TouchableOpacity style={[styles.centeredJustify, styles.darkGreen, styles.menuButton, styles.dropShadow]}>
Loading... <Text style={[styles.lightText, styles.headerTitleFont, styles.boldText, styles.centeredText]}>
Start
</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.centeredJustify, styles.darkGreen, styles.menuButton, styles.dropShadow]}>
<Text style={[styles.lightText, styles.headerTitleFont, styles.boldText, styles.centeredText]}>
High Scores
</Text> </Text>
</TouchableOpacity>
</View> </View>
</View> </View>
) )

10
squarenotsquare/src/screens/styles/AppStyles.js

@ -76,6 +76,10 @@ export const styles = StyleSheet.create({
backgroundColor: Colors.material.green400 backgroundColor: Colors.material.green400
}, },
darkGreen: {
backgroundColor: Colors.material.green400dark
},
splashLogo: { splashLogo: {
width: Metrics.images.splashLogo.width, width: Metrics.images.splashLogo.width,
height: Metrics.images.splashLogo.height height: Metrics.images.splashLogo.height
@ -83,5 +87,11 @@ export const styles = StyleSheet.create({
smallMargin: { smallMargin: {
margin: Metrics.margins.default margin: Metrics.margins.default
},
menuButton: {
borderRadius: Metrics.buttons.borderRadius,
width: Metrics.buttons.menuButton.width,
height: Metrics.buttons.menuButton.height
} }
}) })

8
squarenotsquare/src/themes/Metrics.js

@ -42,6 +42,14 @@ class AppMetrics {
this.margins = { this.margins = {
default: this.normalize(5) default: this.normalize(5)
} }
this.buttons = {
borderRadius: 10,
menuButton: {
height: this.normalize(30),
width: this.screenWidth * 0.7
}
}
} }
normalize(size){ normalize(size){

Loading…
Cancel
Save