Pertemuan ke 9: 2025-06-05
This commit is contained in:
parent
95670084f7
commit
c91d7c32b4
BIN
assets/illustration/66139.jpg
Normal file
BIN
assets/illustration/66139.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1005 KiB |
BIN
assets/illustration/cheeky.png
Normal file
BIN
assets/illustration/cheeky.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
@ -1,15 +1,60 @@
|
|||||||
import { StyleSheet, Text, View } from 'react-native';
|
import { StyleSheet, Text, View, Image, TouchableOpacity, FlatList } from 'react-native';
|
||||||
import Container from '../components/Container';
|
import Container from '../components/Container';
|
||||||
|
|
||||||
const ScreenHome = ({ navigation }) => {
|
const ScreenHome = ({ navigation }) => {
|
||||||
|
|
||||||
|
const menuItems = [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
title: 'Apa aja',
|
||||||
|
icon: require('../assets/illustration/cheeky.png'),
|
||||||
|
screen: 'Contoh',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
title: 'Boleh',
|
||||||
|
icon: require('../assets/illustration/cheeky.png'),
|
||||||
|
screen: 'Contoh',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
title: 'Boleh',
|
||||||
|
icon: require('../assets/illustration/cheeky.png'),
|
||||||
|
screen: 'Contoh',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const renderItem = ({ item }) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={styles.menuItem}
|
||||||
|
onPress={() => navigation.navigate(item.screen)}
|
||||||
|
>
|
||||||
|
<Image source={item.icon} style={styles.menuIcon} />
|
||||||
|
<Text style={styles.menuTitle}>{item.title}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
|
|
||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
<Text>Ini Header</Text>
|
<Image
|
||||||
</View>
|
source={require('../assets/illustration/66139.jpg')}
|
||||||
<View style={styles.main}>
|
style={styles.headerImage}
|
||||||
<Text>Ini Main Content</Text>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<Text style={styles.title}>Check Care</Text>
|
||||||
|
|
||||||
|
<FlatList
|
||||||
|
data={menuItems}
|
||||||
|
numColumns={3}
|
||||||
|
renderItem={renderItem}
|
||||||
|
keyExtractor={(item) => item.key}
|
||||||
|
contentContainerStyle={styles.menuGrid}
|
||||||
|
/>
|
||||||
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -19,10 +64,39 @@ const styles = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#FFDDDD"
|
backgroundColor: "#FFDDDD"
|
||||||
},
|
},
|
||||||
|
headerImage: {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
resizeMode: 'cover',
|
||||||
|
position: 'absolute',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontSize: 36,
|
||||||
|
textAlign: 'center',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
},
|
||||||
main: {
|
main: {
|
||||||
flex: 3,
|
flex: 3,
|
||||||
backgroundColor: "#DDFFDD"
|
backgroundColor: "#DDFFDD"
|
||||||
}
|
},
|
||||||
|
menuGrid: {
|
||||||
|
marginTop: 20,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
menuItem: {
|
||||||
|
flex: 1,
|
||||||
|
margin: 10,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
menuIcon: {
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
|
menuTitle: {
|
||||||
|
fontSize: 14,
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default ScreenHome;
|
export default ScreenHome;
|
Loading…
Reference in New Issue
Block a user