From 03fa90872ae165ac6c67b6aee2b5e07bd628e520 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 18 Dec 2024 12:55:29 -0600 Subject: [PATCH] Revert RadioButton changes --- src/view/com/util/forms/RadioButton.tsx | 124 +++++++++++------------- 1 file changed, 55 insertions(+), 69 deletions(-) diff --git a/src/view/com/util/forms/RadioButton.tsx b/src/view/com/util/forms/RadioButton.tsx index a3bb98dece..7cf0f2d731 100644 --- a/src/view/com/util/forms/RadioButton.tsx +++ b/src/view/com/util/forms/RadioButton.tsx @@ -19,70 +19,6 @@ export function RadioButton({ isSelected: boolean style?: StyleProp onPress: () => void -}) { - const theme = useTheme() - const labelStyle = choose>(type, { - primary: { - color: theme.palette.primary.text, - fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, - }, - secondary: { - color: theme.palette.secondary.text, - fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, - }, - inverted: { - color: theme.palette.inverted.text, - fontWeight: theme.palette.inverted.isLowContrast ? '600' : undefined, - }, - 'primary-outline': { - color: theme.palette.primary.textInverted, - fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, - }, - 'secondary-outline': { - color: theme.palette.secondary.textInverted, - fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, - }, - 'primary-light': { - color: theme.palette.primary.textInverted, - fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, - }, - 'secondary-light': { - color: theme.palette.secondary.textInverted, - fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, - }, - default: { - color: theme.palette.default.text, - fontWeight: theme.palette.default.isLowContrast ? '600' : undefined, - }, - 'default-light': { - color: theme.palette.default.text, - fontWeight: theme.palette.default.isLowContrast ? '600' : undefined, - }, - }) - return ( - - ) -} - -export function RadioCircle({ - isSelected, - marginRight, - type = 'default-light', -}: { - isSelected: boolean - type?: ButtonType - marginRight?: number }) { const theme = useTheme() const circleStyle = choose>(type, { @@ -146,12 +82,61 @@ export function RadioCircle({ }, }, ) + const labelStyle = choose>(type, { + primary: { + color: theme.palette.primary.text, + fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, + }, + secondary: { + color: theme.palette.secondary.text, + fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, + }, + inverted: { + color: theme.palette.inverted.text, + fontWeight: theme.palette.inverted.isLowContrast ? '600' : undefined, + }, + 'primary-outline': { + color: theme.palette.primary.textInverted, + fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, + }, + 'secondary-outline': { + color: theme.palette.secondary.textInverted, + fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, + }, + 'primary-light': { + color: theme.palette.primary.textInverted, + fontWeight: theme.palette.primary.isLowContrast ? '600' : undefined, + }, + 'secondary-light': { + color: theme.palette.secondary.textInverted, + fontWeight: theme.palette.secondary.isLowContrast ? '600' : undefined, + }, + default: { + color: theme.palette.default.text, + fontWeight: theme.palette.default.isLowContrast ? '600' : undefined, + }, + 'default-light': { + color: theme.palette.default.text, + fontWeight: theme.palette.default.isLowContrast ? '600' : undefined, + }, + }) return ( - - {isSelected ? ( - - ) : undefined} - + ) } @@ -166,6 +151,7 @@ const styles = StyleSheet.create({ borderRadius: 15, padding: 4, borderWidth: 1, + marginRight: 10, }, circleFill: { width: 16,