Skip to content

Commit 990cc74

Browse files
committed
lesson-18
1 parent 68a2585 commit 990cc74

5 files changed

Lines changed: 28 additions & 30 deletions

File tree

gamezone/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ export default function App() {
2424
)
2525
}
2626

27-
}
27+
}

gamezone/screens/about.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import React from 'react';
22
import { StyleSheet, View, Text } from 'react-native';
3+
import { globalStyles } from './styles/global';
34

45
export default function About() {
56
return (
6-
<View style={styles.container}>
7+
<View style={globalStyles.container}>
78
<Text>About Screen</Text>
89
</View>
910
);
10-
}
11-
12-
const styles = StyleSheet.create({
13-
container: {
14-
padding: 24,
15-
},
16-
});
11+
}

gamezone/screens/home.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
import React from 'react';
22
import { StyleSheet, View, Text } from 'react-native';
3+
import { globalStyles } from '../styles/global';
34

45
export default function Home() {
56
return (
6-
<View style={styles.container}>
7-
<Text style={styles.titleText}>Home Screen</Text>
7+
<View style={globalStyles.container}>
8+
<Text style={globalStyles.titleText}>Home Screen</Text>
89
</View>
910
);
10-
}
11-
12-
const styles = StyleSheet.create({
13-
container: {
14-
padding: 24,
15-
},
16-
titleText: {
17-
fontFamily: 'nunito-bold',
18-
fontSize: 18,
19-
}
20-
});
11+
}

gamezone/screens/reviewDetails.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import React from 'react';
22
import { StyleSheet, View, Text } from 'react-native';
3+
import { globalStyles } from '../styles/global';
34

45
export default function ReviewDetails() {
56
return (
6-
<View style={styles.container}>
7+
<View style={globalStyles.container}>
78
<Text>ReviewDetails Screen</Text>
89
</View>
910
);
10-
}
11-
12-
const styles = StyleSheet.create({
13-
container: {
14-
padding: 24,
15-
},
16-
});
11+
}

gamezone/styles/global.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
export const globalStyles = StyleSheet.create({
4+
titleText: {
5+
fontSize: 18,
6+
fontWeight: 'bold',
7+
color: '#333',
8+
},
9+
paragraph: {
10+
marginVertical: 8,
11+
lineHeight: 20,
12+
},
13+
container: {
14+
flex: 1,
15+
padding: 20,
16+
},
17+
});

0 commit comments

Comments
 (0)