Added Icons and buttons to module view

This commit is contained in:
bobbert committed 2025-12-03 21:26:20 +00:00
1 parent 31c2208c2e
commit 8164fab184
7 files changed
+111 -37

No files matched your search

+45 -4
View File
@@ -1,6 +1,6 @@
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
import {Pressable, StyleSheet, Text, View} from "react-native";
const Component = () => {
export const Button = ({label, icon, onClick, styleLabel, styleButton}) => {
// Initialisation -------------
// State ----------------------
@@ -8,10 +8,51 @@ const Component = () => {
// View -----------------------
return (
<Pressable onPress={onClick} style={[styles.button, styleButton]}>
{
icon ? icon : null
}
<Text style={[styles.label, styleLabel]}>
{label}
</Text>
</Pressable>
);
};
const styles = StyleSheet.create({});
export const ButtonTray = ({children}) => {
export default Component;
// Initialisation -------------
// State ----------------------
// Handlers -------------------
// View -----------------------
return (
<View style={styles.buttonTray}>{children}</View>
);
};
const styles = StyleSheet.create({
button: {
minHeight: 50,
borderWidth: 1,
borderRadius: 7,
borderColor: 'grey',
backgroundColor: 'white',
alignItems: 'center',
justifyContent: 'center',
padding: 3,
flex: 1,
flexDirection: 'row',
gap: 5,
},
label: {
fontSize: 16,
},
buttonTray: {
flexDirection: 'row',
gap: 15,
}
});
+15
View File
@@ -0,0 +1,15 @@
import {MaterialIcons} from '@expo/vector-icons'
const Icons = {};
const Edit = () => <MaterialIcons name='edit' size={16}/>;
const Delete = () => <MaterialIcons name='delete' size={16}/>;
const Add = () => <MaterialIcons name='add' size={16}/>;
//compose
Icons.Edit = Edit;
Icons.Delete = Delete;
Icons.Add = Add;
export default Icons;