aboutsummaryrefslogtreecommitdiff
path: root/mobile/screens
diff options
context:
space:
mode:
authorKumar Damani <kumar.damani@mail.utoronto.ca>2019-02-18 23:09:52 +0000
committerKumar Damani <kumar.damani@mail.utoronto.ca>2019-02-18 23:09:52 +0000
commit829998568f4e8a44971a9fe7e46a76ec9316cc81 (patch)
treeda54e78dbf12ebc92b5d6517d38eddcf7cc269b4 /mobile/screens
parentfd80834e586232d28b8763a1e399ffa57d14fe2d (diff)
fixed folder structure
Diffstat (limited to 'mobile/screens')
-rw-r--r--mobile/screens/HomeScreen.js188
-rw-r--r--mobile/screens/LinksScreen.js27
-rw-r--r--mobile/screens/SettingsScreen.js14
3 files changed, 229 insertions, 0 deletions
diff --git a/mobile/screens/HomeScreen.js b/mobile/screens/HomeScreen.js
new file mode 100644
index 0000000..0d3548e
--- /dev/null
+++ b/mobile/screens/HomeScreen.js
@@ -0,0 +1,188 @@
+import React from 'react';
+import {
+ Image,
+ Platform,
+ ScrollView,
+ StyleSheet,
+ Text,
+ TouchableOpacity,
+ View,
+} from 'react-native';
+import { WebBrowser } from 'expo';
+
+import { MonoText } from '../components/StyledText';
+
+export default class HomeScreen extends React.Component {
+ static navigationOptions = {
+ header: null,
+ };
+
+ render() {
+ return (
+ <View style={styles.container}>
+ <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')
+ }
+ style={styles.welcomeImage}
+ />
+ </View>
+
+ <View style={styles.getStartedContainer}>
+ {this._maybeRenderDevelopmentModeWarning()}
+
+ <Text style={styles.getStartedText}>Get started by opening</Text>
+
+ <View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
+ <MonoText style={styles.codeHighlightText}>screens/HomeScreen.js</MonoText>
+ </View>
+
+ <Text style={styles.getStartedText}>
+ Change this text and your app will automatically reload.
+ </Text>
+ </View>
+
+ <View style={styles.helpContainer}>
+ <TouchableOpacity onPress={this._handleHelpPress} style={styles.helpLink}>
+ <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>
+
+ <View style={[styles.codeHighlightContainer, styles.navigationFilename]}>
+ <MonoText style={styles.codeHighlightText}>navigation/MainTabNavigator.js</MonoText>
+ </View>
+ </View>
+ </View>
+ );
+ }
+
+ _maybeRenderDevelopmentModeWarning() {
+ if (__DEV__) {
+ const learnMoreButton = (
+ <Text onPress={this._handleLearnMorePress} style={styles.helpLinkText}>
+ Learn more
+ </Text>
+ );
+
+ return (
+ <Text style={styles.developmentModeText}>
+ Development mode is enabled, your app will be slower but you can use useful development
+ tools. {learnMoreButton}
+ </Text>
+ );
+ } else {
+ return (
+ <Text style={styles.developmentModeText}>
+ You are not in development mode, your app will run at full speed.
+ </Text>
+ );
+ }
+ }
+
+ _handleLearnMorePress = () => {
+ WebBrowser.openBrowserAsync('https://docs.expo.io/versions/latest/guides/development-mode');
+ };
+
+ _handleHelpPress = () => {
+ WebBrowser.openBrowserAsync(
+ 'https://docs.expo.io/versions/latest/guides/up-and-running.html#can-t-see-your-changes'
+ );
+ };
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ backgroundColor: '#fff',
+ },
+ developmentModeText: {
+ marginBottom: 20,
+ color: 'rgba(0,0,0,0.4)',
+ fontSize: 14,
+ lineHeight: 19,
+ textAlign: 'center',
+ },
+ contentContainer: {
+ paddingTop: 30,
+ },
+ welcomeContainer: {
+ alignItems: 'center',
+ marginTop: 10,
+ marginBottom: 20,
+ },
+ welcomeImage: {
+ width: 100,
+ height: 80,
+ resizeMode: 'contain',
+ marginTop: 3,
+ marginLeft: -10,
+ },
+ getStartedContainer: {
+ alignItems: 'center',
+ marginHorizontal: 50,
+ },
+ homeScreenFilename: {
+ marginVertical: 7,
+ },
+ codeHighlightText: {
+ color: 'rgba(96,100,109, 0.8)',
+ },
+ codeHighlightContainer: {
+ backgroundColor: 'rgba(0,0,0,0.05)',
+ borderRadius: 3,
+ paddingHorizontal: 4,
+ },
+ getStartedText: {
+ fontSize: 17,
+ color: 'rgba(96,100,109, 1)',
+ lineHeight: 24,
+ textAlign: 'center',
+ },
+ tabBarInfoContainer: {
+ position: 'absolute',
+ bottom: 0,
+ left: 0,
+ right: 0,
+ ...Platform.select({
+ ios: {
+ shadowColor: 'black',
+ shadowOffset: { height: -3 },
+ shadowOpacity: 0.1,
+ shadowRadius: 3,
+ },
+ android: {
+ elevation: 20,
+ },
+ }),
+ alignItems: 'center',
+ backgroundColor: '#fbfbfb',
+ paddingVertical: 20,
+ },
+ tabBarInfoText: {
+ fontSize: 17,
+ color: 'rgba(96,100,109, 1)',
+ textAlign: 'center',
+ },
+ navigationFilename: {
+ marginTop: 5,
+ },
+ helpContainer: {
+ marginTop: 15,
+ alignItems: 'center',
+ },
+ helpLink: {
+ paddingVertical: 15,
+ },
+ helpLinkText: {
+ fontSize: 14,
+ color: '#2e78b7',
+ },
+});
diff --git a/mobile/screens/LinksScreen.js b/mobile/screens/LinksScreen.js
new file mode 100644
index 0000000..7bb4a62
--- /dev/null
+++ b/mobile/screens/LinksScreen.js
@@ -0,0 +1,27 @@
+import React from 'react';
+import { ScrollView, StyleSheet } from 'react-native';
+import { ExpoLinksView } from '@expo/samples';
+
+export default class LinksScreen extends React.Component {
+ static navigationOptions = {
+ title: 'Links',
+ };
+
+ render() {
+ return (
+ <ScrollView style={styles.container}>
+ {/* Go ahead and delete ExpoLinksView and replace it with your
+ * content, we just wanted to provide you with some helpful links */}
+ <ExpoLinksView />
+ </ScrollView>
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ paddingTop: 15,
+ backgroundColor: '#fff',
+ },
+});
diff --git a/mobile/screens/SettingsScreen.js b/mobile/screens/SettingsScreen.js
new file mode 100644
index 0000000..6957dcb
--- /dev/null
+++ b/mobile/screens/SettingsScreen.js
@@ -0,0 +1,14 @@
+import React from 'react';
+import { ExpoConfigView } from '@expo/samples';
+
+export default class SettingsScreen extends React.Component {
+ static navigationOptions = {
+ title: 'app.json',
+ };
+
+ render() {
+ /* Go ahead and delete ExpoConfigView and replace it with your
+ * content, we just wanted to give you a quick view of your config */
+ return <ExpoConfigView />;
+ }
+}