This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
interaktive-systeme/components/common/button.tsx
2024-01-03 17:31:59 +00:00

39 lines
1 KiB
TypeScript

import { StyleSheet, Text, TouchableHighlight } from "react-native";
import { useTheme } from "../../app/contexts/ThemeContext";
export type NavigationButtonProperties = {
onPress?: () => void | undefined,
text: string,
}
const NavigationButton = (properties: NavigationButtonProperties) => {
const {colors} = useTheme();
return (
<TouchableHighlight
onPress={properties.onPress}
underlayColor={colors.elementSelectedColor}
style={[styles.touchableHighlightStyle, {backgroundColor: colors.elementDefaultColor}]}>
<Text style={[styles.buttonTextStyle, {color: colors.primaryText}]}>{properties.text}</Text>
</TouchableHighlight>
);
}
export default NavigationButton;
const styles = StyleSheet.create({
touchableHighlightStyle: {
borderRadius: 10,
marginVertical: 10,
marginHorizontal: 15,
paddingHorizontal: 20,
paddingVertical: 5,
},
buttonTextStyle: {
textAlign: "center",
fontSize: 30,
}
});