Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 60 additions & 40 deletions screens/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,70 @@
import * as WebBrowser from 'expo-web-browser';
import * as React from 'react';
import { Image, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import * as WebBrowser from "expo-web-browser";
import * as React from "react";
import {
Image,
Platform,
StyleSheet,
Text,
TouchableOpacity,
View,
} from "react-native";
import { ScrollView } from "react-native-gesture-handler";

import { MonoText } from '../components/StyledText';
import { MonoText } from "../components/StyledText";

export default function HomeScreen() {
return (
<View style={styles.container}>
<ScrollView style={styles.container} contentContainerStyle={styles.contentContainer}>
<ScrollView
style={styles.container}
contentContainerStyle={styles.contentContainer}
>
<View style={styles.welcomeContainer}>
<Image
source={
__DEV__
? require('../assets/images/robot-dev.png')
: require('../assets/images/robot-prod.png')
? require("../assets/images/robot-dev.png")
: require("../assets/images/robot-prod.png")
}
style={styles.welcomeImage}
/>
</View>

<View style={styles.getStartedContainer}>
<DevelopmentModeNotice />

<Text style={styles.getStartedText}>
Woohoo! Welcome to the development of the Anxiety App!
</Text>
<Text style={styles.getStartedText}>Open up the code for this screen:</Text>
<Text style={styles.getStartedText}>
Open up the code for this screen:
</Text>

<View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
<View
style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
>
<MonoText>screens/HomeScreen.js</MonoText>
</View>


</View>

<View style={styles.helpContainer}>
<TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}>
<Text style={styles.helpLinkText}>Help, it didn’t automatically reload!</Text>
<Text style={styles.helpLinkText}>
Help, it didn’t automatically reload!
</Text>
</TouchableOpacity>
</View>
</ScrollView>

<View style={styles.tabBarInfoContainer}>
<Text style={styles.tabBarInfoText}>This is a tab bar. You can edit it in:</Text>
<Text style={styles.tabBarInfoText}>
This is a tab bar. You can edit it in:
</Text>

<View style={[styles.codeHighlightContainer, styles.navigationFilename]}>
<MonoText style={styles.codeHighlightText}>navigation/BottomTabNavigator.js</MonoText>
<View
style={[styles.codeHighlightContainer, styles.navigationFilename]}
>
<MonoText style={styles.codeHighlightText}>
navigation/BottomTabNavigator.js
</MonoText>
</View>
</View>
</View>
Expand All @@ -67,8 +85,8 @@ function DevelopmentModeNotice() {

return (
<Text style={styles.developmentModeText}>
Development mode is enabled: your app will be slower but you can use useful development
tools. {learnMoreButton}
Development mode is enabled: your app will be slower but you can use
useful development tools. {learnMoreButton}
</Text>
);
} else {
Expand All @@ -81,71 +99,73 @@ function DevelopmentModeNotice() {
}

function handleLearnMorePress() {
WebBrowser.openBrowserAsync('https://docs.expo.io/versions/latest/workflow/development-mode/');
WebBrowser.openBrowserAsync(
"https://docs.expo.io/versions/latest/workflow/development-mode/"
);
}

function handleHelpPress() {
WebBrowser.openBrowserAsync(
'https://docs.expo.io/versions/latest/get-started/create-a-new-app/#making-your-first-change'
"https://docs.expo.io/versions/latest/get-started/create-a-new-app/#making-your-first-change"
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
backgroundColor: "#fff",
},
developmentModeText: {
marginBottom: 20,
color: 'rgba(0,0,0,0.4)',
color: "rgba(0,0,0,0.4)",
fontSize: 14,
lineHeight: 19,
textAlign: 'center',
textAlign: "center",
},
contentContainer: {
paddingTop: 30,
},
welcomeContainer: {
alignItems: 'center',
alignItems: "center",
marginTop: 10,
marginBottom: 20,
},
welcomeImage: {
width: 100,
height: 80,
resizeMode: 'contain',
resizeMode: "contain",
marginTop: 3,
marginLeft: -10,
},
getStartedContainer: {
alignItems: 'center',
alignItems: "center",
marginHorizontal: 50,
},
homeScreenFilename: {
marginVertical: 7,
},
codeHighlightText: {
color: 'rgba(96,100,109, 0.8)',
color: "rgba(96,100,109, 0.8)",
},
codeHighlightContainer: {
backgroundColor: 'rgba(0,0,0,0.05)',
backgroundColor: "rgba(0,0,0,0.05)",
borderRadius: 3,
paddingHorizontal: 4,
},
getStartedText: {
fontSize: 17,
color: 'rgba(96,100,109, 1)',
color: "rgba(96,100,109, 1)",
lineHeight: 24,
textAlign: 'center',
textAlign: "center",
},
tabBarInfoContainer: {
position: 'absolute',
position: "absolute",
bottom: 0,
left: 0,
right: 0,
...Platform.select({
ios: {
shadowColor: 'black',
shadowColor: "black",
shadowOffset: { width: 0, height: -3 },
shadowOpacity: 0.1,
shadowRadius: 3,
Expand All @@ -154,27 +174,27 @@ const styles = StyleSheet.create({
elevation: 20,
},
}),
alignItems: 'center',
backgroundColor: '#fbfbfb',
alignItems: "center",
backgroundColor: "#fbfbfb",
paddingVertical: 20,
},
tabBarInfoText: {
fontSize: 17,
color: 'rgba(96,100,109, 1)',
textAlign: 'center',
color: "rgba(96,100,109, 1)",
textAlign: "center",
},
navigationFilename: {
marginTop: 5,
},
helpContainer: {
marginTop: 15,
alignItems: 'center',
alignItems: "center",
},
helpLink: {
paddingVertical: 15,
},
helpLinkText: {
fontSize: 14,
color: '#2e78b7',
color: "#2e78b7",
},
});