Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Pressable/PressableWithoutFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {PressableRef} from './GenericPressable/types';
import type PressableProps from './GenericPressable/types';

function PressableWithoutFeedback(
{pressStyle, hoverStyle, focusStyle, screenReaderActiveStyle, shouldUseHapticsOnPress, shouldUseHapticsOnLongPress = false, ...rest}: PressableProps,
{pressStyle, focusStyle, screenReaderActiveStyle, shouldUseHapticsOnPress, shouldUseHapticsOnLongPress = false, ...rest}: PressableProps,
ref: PressableRef,
) {
return (
Expand Down
9 changes: 8 additions & 1 deletion src/components/RadioButtonWithLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ type RadioButtonWithLabelProps = {

/** Additional styles to apply to the wrapper */
wrapperStyle?: StyleProp<ViewStyle>;

/**
* Whether the button should have a background layer in the color of theme.appBG.
* This is needed for buttons that allow content to display under them.
*/
shouldBlendOpacity?: boolean;
};

const PressableWithFeedback = Pressables.PressableWithFeedback;

function RadioButtonWithLabel({labelElement, style, label = '', hasError = false, errorText = '', isChecked, onPress, wrapperStyle}: RadioButtonWithLabelProps) {
function RadioButtonWithLabel({labelElement, style, label = '', hasError = false, errorText = '', isChecked, onPress, wrapperStyle, shouldBlendOpacity}: RadioButtonWithLabelProps) {
const styles = useThemeStyles();
const defaultStyles = [styles.flexRow, styles.alignItemsCenter];

Expand All @@ -61,6 +67,7 @@ function RadioButtonWithLabel({labelElement, style, label = '', hasError = false
// disable hover style when disabled
hoverDimmingValue={0.8}
pressDimmingValue={0.5}
shouldBlendOpacity={shouldBlendOpacity}
>
{!!label && <Text style={[styles.ml1]}>{label}</Text>}
{!!labelElement && labelElement}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ function BaseOnboardingAccounting({shouldUseNativeStyles}: BaseOnboardingAccount
onPress={() => handleIntegrationSelect(item.keyForList)}
accessibilityLabel={item.text}
accessible={false}
style={[styles.onboardingAccountingItem, isSmallScreenWidth && styles.flexBasis100]}
hoverStyle={!item.isSelected ? styles.hoveredComponentBG : undefined}
style={[styles.onboardingAccountingItem, isSmallScreenWidth && styles.flexBasis100, item.isSelected && styles.activeComponentBG]}
>
<RadioButtonWithLabel
isChecked={!!item.isSelected}
Expand All @@ -288,6 +289,7 @@ function BaseOnboardingAccounting({shouldUseNativeStyles}: BaseOnboardingAccount
<Text style={styles.textStrong}>{item.text}</Text>
</View>
}
shouldBlendOpacity
/>
</PressableWithoutFeedback>
),
Expand All @@ -301,6 +303,8 @@ function BaseOnboardingAccounting({shouldUseNativeStyles}: BaseOnboardingAccount
styles.ml0,
styles.onboardingAccountingItem,
styles.textStrong,
styles.hoveredComponentBG,
styles.activeComponentBG,
],
);

Expand Down