Browse Source

Adding custom text colors in ConfirmationModal buttons

master
GabrielTrettel 3 years ago
parent
commit
f20311548c
  1. 10
      src/app/components/ConfirmationModal.js

10
src/app/components/ConfirmationModal.js

@ -4,18 +4,17 @@ import colors from "../config/colors";
import { dimensions } from "../config/dimensions"; import { dimensions } from "../config/dimensions";
function Btn({ label, onPress, bgColor, txtColor }) { function Btn({ label, onPress, bgColor, txtColor }) {
console.log("pimba");
return ( return (
<TouchableOpacity onPress={onPress}> <TouchableOpacity onPress={onPress}>
<View <View
style={{ style={{
paddingHorizontal: 30,
paddingVertical: 5,
paddingHorizontal: 40,
paddingVertical: 7,
backgroundColor: bgColor, backgroundColor: bgColor,
borderRadius: 6, borderRadius: 6,
}} }}
> >
<Text>{label}</Text>
<Text style={{color: txtColor, fontWeight: "bold"}}>{label}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
); );
@ -30,7 +29,6 @@ export default function ConfirmationModal({
onConfirm = () => {}, onConfirm = () => {},
onDecline = () => {}, onDecline = () => {},
}) { }) {
console.log("show: " + show);
return ( return (
<Modal <Modal
transparent={true} transparent={true}
@ -66,11 +64,13 @@ export default function ConfirmationModal({
label={confirmationLabel} label={confirmationLabel}
onPress={onConfirm} onPress={onConfirm}
bgColor={colors.secondary} bgColor={colors.secondary}
txtColor={colors.white}
/> />
<Btn <Btn
label={declineLabel} label={declineLabel}
onPress={onDecline} onPress={onDecline}
bgColor={colors.lightGray} bgColor={colors.lightGray}
txtColor={colors.black}
/> />
</View> </View>
</View> </View>

Loading…
Cancel
Save