This repository has been archived on 2024-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
p61-project/presentation/react/components/ButtonCustom.tsx

35 lines
792 B
TypeScript
Raw Normal View History

2024-02-16 22:51:50 +01:00
import type { StyleProp, ViewStyle } from "react-native"
import { Pressable, StyleSheet, Text } from "react-native"
export interface ButtonCustomProps
extends React.ComponentProps<typeof Pressable> {
children: React.ReactNode
style?: StyleProp<ViewStyle>
}
export const ButtonCustom: React.FC<ButtonCustomProps> = (props) => {
const { children, style, ...rest } = props
return (
<Pressable style={[styles.button, style]} {...rest}>
<Text style={styles.text}>{children}</Text>
</Pressable>
)
}
const styles = StyleSheet.create({
button: {
padding: 10,
borderWidth: 1,
borderColor: "black",
borderRadius: 10,
marginTop: 10,
backgroundColor: "#152B5D",
},
text: {
color: "white",
textAlign: "center",
fontSize: 15,
},
})