Skip to content

Commit

Permalink
Add Screen and navigator, along with fonts and images
Browse files Browse the repository at this point in the history
  • Loading branch information
MHassanA98 committed Apr 19, 2020
1 parent 3479c5b commit 9523a88
Show file tree
Hide file tree
Showing 18 changed files with 243 additions and 109 deletions.
160 changes: 51 additions & 109 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,114 +1,56 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/

import React, { useState } from 'react';
// import * as Font from 'expo-font';
// import { AppLoading } from 'expo';
import StackNavigator from './routes/HomeStack'
import { StyleSheet, Text, View, Image, ImageBackground } from 'react-native';

import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
export default function App() {
// const [fontsLoaded, setFontsLoaded] = useState(false);
return(

import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
<StackNavigator/>

const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Step One</Text>
<Text style={styles.sectionDescription}>
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>See Your Changes</Text>
<Text style={styles.sectionDescription}>
<ReloadInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Debug</Text>
<Text style={styles.sectionDescription}>
<DebugInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Learn More</Text>
<Text style={styles.sectionDescription}>
Read the docs to discover what to do next:
</Text>
</View>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
</>
);
};
// <View style={styles.home}>
// <Text style={styles.text}>
// HELLO HOME
// </Text>
// <ImageBackground source= {require('./assets/images/food')}>

// </ImageBackground>

const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter,
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: Colors.white,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});

export default App;


// </View>
// if (fontsLoaded) {
// return (
// <Navigator />
// );
// } else {
// return (
// <AppLoading
// startAsync={getFonts}
// onFinish={() => setFontsLoaded(true)}
// />
// )
// }
)
}

const styles=StyleSheet.create({
home: {
flex: 0,
backgroundColor:'red'

},
text: {
fontFamily: 'Roboto-Bold',
// fontWeight: 'bold',
paddingLeft: 16,
fontSize: 32
}



})
114 changes: 114 additions & 0 deletions AppP.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/

import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';

import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Step One</Text>
<Text style={styles.sectionDescription}>
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>See Your Changes</Text>
<Text style={styles.sectionDescription}>
<ReloadInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Debug</Text>
<Text style={styles.sectionDescription}>
<DebugInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Learn More</Text>
<Text style={styles.sectionDescription}>
Read the docs to discover what to do next:
</Text>
</View>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
</>
);
};

const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter,
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: Colors.white,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});

export default App;
Binary file added assets/fonts/Roboto-Black.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-BlackItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-BoldItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Italic.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Light.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-LightItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-MediumItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-Thin.ttf
Binary file not shown.
Binary file added assets/fonts/Roboto-ThinItalic.ttf
Binary file not shown.
Binary file added assets/images/Kitchen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Store.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions routes/HomeStack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { createStackNavigator } from 'react-navigation-stack';
import { createAppContainer } from 'react-navigation';
import Home from '../screens/home';
// import ReviewDetails from '../screens/reviewDetails';

const screens = {
Home: {
screen: Home,
},
// ReviewDetails: {
// screen: ReviewDetails,
// },
};

// home stack navigator screens
const HomeStack = createStackNavigator(screens, {
defaultNavigationOptions: {
headerTintColor: '#444',
headerStyle: { backgroundColor: '#d00f16', height: 60 }
}
});

export default createAppContainer(HomeStack);
55 changes: 55 additions & 0 deletions screens/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

import React, { useState } from 'react';
// import * as Font from 'expo-font';
// import { AppLoading } from 'expo';
// import Navigator from './route/NavigDraw'
import { StyleSheet, Text, View, Image, ImageBackground } from 'react-native';

export default function Home() {
// const [fontsLoaded, setFontsLoaded] = useState(false);
return(

<View style={styles.home}>

<Image source= {require('../assets/images/Kitchen.jpg')} style={styles.image}>
<Text style={styles.text}>
HELLO HOME
</Text>
</Image>

</View>
// if (fontsLoaded) {
// return (
// <Navigator />
// );
// } else {
// return (
// <AppLoading
// startAsync={getFonts}
// onFinish={() => setFontsLoaded(true)}
// />
// )
// }
)
}

const styles=StyleSheet.create({
home: {
flex: 0,
backgroundColor:'red'

},
text: {
fontFamily: 'Roboto-Bold',
// fontWeight: 'bold',
paddingLeft: 16,
fontSize: 32
},
image:{
justifyContent: 'center',
alignItems: 'center'
}



})

0 comments on commit 9523a88

Please sign in to comment.