Browse Source

Fixing spacing and alignment of confirmation modal buttons

master
GabrielTrettel 3 years ago
parent
commit
63a5e5c718
  1. 11
      src/app/components/ConfirmationModal.js

11
src/app/components/ConfirmationModal.js

@ -4,16 +4,16 @@ import colors from "../config/colors";
import { dimensions } from "../config/dimensions"; import { dimensions } from "../config/dimensions";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
function Btn({ label, onPress, bgColor, txtColor }) {
function Btn({ label, onPress, bgColor, txtColor, style={} }) {
return ( return (
<TouchableOpacity style={{marginTop: 15}} onPress={onPress}> <TouchableOpacity style={{marginTop: 15}} onPress={onPress}>
<View <View
style={{
style={[style, {
paddingHorizontal: 40, paddingHorizontal: 40,
paddingVertical: 7, paddingVertical: 7,
backgroundColor: bgColor, backgroundColor: bgColor,
borderRadius: 6, borderRadius: 6,
}}
}]}
> >
<Text style={{ color: txtColor, fontWeight: "bold" }}>{label}</Text> <Text style={{ color: txtColor, fontWeight: "bold" }}>{label}</Text>
</View> </View>
@ -67,12 +67,13 @@ export default function ConfirmationModal({
<View <View
style={{ style={{
flexDirection: "row", flexDirection: "row",
justifyContent: "space-evenly",
justifyContent: "flex-end",
marginTop: 24, marginTop: 24,
}} }}
> >
{onConfirm && confirmationLabel && ( {onConfirm && confirmationLabel && (
<Btn <Btn
style={{marginRight: 16}}
label={confirmationLabel} label={confirmationLabel}
onPress={onConfirm} onPress={onConfirm}
bgColor={colors.primary} bgColor={colors.primary}
@ -105,7 +106,7 @@ const styles = StyleSheet.create({
borderWidth: 2, borderWidth: 2,
borderRadius: 12, borderRadius: 12,
paddingVertical: 16, paddingVertical: 16,
paddingHorizontal: 12,
paddingHorizontal: 16,
}, },
text: { text: {
fontSize: dimensions.text.default, fontSize: dimensions.text.default,

Loading…
Cancel
Save