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/RoundedButton.tsx
2024-01-05 00:46:40 +01:00

32 lines
No EOL
805 B
TypeScript

import { StyleSheet, Text, View, ViewProps, TouchableOpacity } from 'react-native'
import React from 'react'
import { SIZES } from '../../constants/theme';
interface RoundedButtonProps extends ViewProps{
onPress?: ()=> void | undefined;
color: string;
}
const RoundedButton: React.FC<RoundedButtonProps> = (props: RoundedButtonProps) => {
const {onPress, color, style, ...restProps} = props;
return (
<TouchableOpacity onPress={onPress}>
<View style={[{backgroundColor: color}, styles.btn, style]}{...restProps}>
{restProps.children}
</View>
</TouchableOpacity>
)
}
export default RoundedButton
const styles = StyleSheet.create({
btn:{
justifyContent: 'center',
alignItems: 'center',
borderRadius: 80
},
text: {
fontSize: SIZES.normal
}
})