easier ui handling
This commit is contained in:
parent
4a1175ed21
commit
3e30ee41cf
|
|
@ -1,22 +1,27 @@
|
|||
import { StyleSheet, Text, View} from 'react-native';
|
||||
import { StyleSheet, Text, TouchableOpacity} from 'react-native';
|
||||
|
||||
export default function Button({ title='', theme={}, onPress, style={} }:any){
|
||||
return (
|
||||
<Text onPress={onPress} style={{...cstyle(theme).button, ...style}}>{title}</Text>
|
||||
<TouchableOpacity onPress={onPress} style={{...cstyle(theme).button, ...style}}>
|
||||
<Text style={cstyle(theme).text}>{title}</Text>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
|
||||
const cstyle = (theme:any) => {
|
||||
return StyleSheet.create({
|
||||
container: {
|
||||
},
|
||||
button: {
|
||||
backgroundColor: theme.primary,
|
||||
padding: 10,
|
||||
alignContent: 'center',
|
||||
textAlign: 'center',
|
||||
justifyContent: 'center',
|
||||
color: theme.text,
|
||||
margin: 10,
|
||||
borderRadius: 5,
|
||||
},
|
||||
text: {
|
||||
color: theme.text,
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue