Skip to content

Commit 9f6e037

Browse files
committed
refactor: add styling
1 parent e901250 commit 9f6e037

2 files changed

Lines changed: 39 additions & 13 deletions

File tree

src/screens/about.tsx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useNavigation, useRoute } from '@react-navigation/native';
2-
import { View, Text } from 'react-native';
2+
import { View, Text, StyleSheet } from 'react-native';
33
import { Button } from '@react-navigation/elements';
44

55
export type AboutScreenProps = {
@@ -13,9 +13,29 @@ export function AboutScreen() {
1313
const { depth } = route.params as AboutScreenProps;
1414

1515
return (
16-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
17-
<Text>You are currently {depth} screens deep</Text>
18-
<Button onPress={() => navigation.popTo('Home')}>Go Home</Button>
19-
</View>
16+
<>
17+
<View style={styles.container}>
18+
<Text>ACME Mission Manager</Text>
19+
<Text>v0.0.1 (build 13)</Text>
20+
<Text>© 2025 ACME Industries LTD</Text>
21+
</View>
22+
<View style={styles.footer}>
23+
<Button onPress={() => navigation.popTo('Home')}>Back</Button>
24+
</View>
25+
</>
2026
);
21-
}
27+
}
28+
29+
const styles = StyleSheet.create({
30+
container: {
31+
flex: 1,
32+
flexDirection: 'column',
33+
alignItems: 'center',
34+
gap: '2',
35+
justifyContent: 'center',
36+
},
37+
footer: {
38+
alignItems: 'center',
39+
paddingBottom: 10,
40+
}
41+
});

src/screens/home.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,27 @@ export function HomeScreen() {
1313
const { message } = route.params as HomeScreenProps;
1414

1515
return (
16-
<View style={styles.container}>
17-
<Text>{message}</Text>
18-
<Button style={styles.bottom} onPress={() => navigation.push('About')}>Go to Details</Button>
19-
</View>
16+
<>
17+
<View style={styles.container}>
18+
<Text>{message}</Text>
19+
</View>
20+
<View style={styles.footer}>
21+
<Button onPress={() => navigation.push('About')}>About</Button>
22+
</View>
23+
</>
2024
);
2125
}
2226

2327
const styles = StyleSheet.create({
2428
container: {
2529
flex: 1,
26-
flexDirection: 'row',
30+
flexDirection: 'column',
2731
alignItems: 'center',
32+
gap: '2',
2833
justifyContent: 'center',
2934
},
30-
bottom: {
31-
alignSelf: 'flex-end',
35+
footer: {
36+
alignItems: 'center',
37+
paddingBottom: 10,
3238
}
3339
});

0 commit comments

Comments
 (0)