Merge pull request #6400 from BlueWallet/buttontext

FIX: Some screens had Button styling was broken
This commit is contained in:
GLaDOS 2024-04-13 06:25:42 +00:00 committed by GitHub
commit d7f3579aee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 12 deletions

View file

@ -41,17 +41,17 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((props, ref) =>
};
const buttonView = (
<View style={[buttonStyle, props.style, styles.content]}>
<>
{props.icon && <Icon name={props.icon.name} type={props.icon.type} color={props.icon.color} />}
{props.title && <Text style={textStyle}>{props.title}</Text>}
</View>
</>
);
return props.onPress ? (
<TouchableOpacity
ref={ref}
testID={props.testID}
style={[buttonStyle, props.style]}
style={[buttonStyle, props.style, styles.content]}
accessibilityRole="button"
onPress={props.onPress}
disabled={props.disabled}
@ -59,7 +59,7 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((props, ref) =>
{buttonView}
</TouchableOpacity>
) : (
buttonView
<View style={[buttonStyle, props.style, styles.content]}>{buttonView}</View>
);
});

View file

@ -11,12 +11,7 @@ interface StyledButtonProps {
buttonStyle?: keyof typeof StyledButtonType;
}
const StyledButton: FC<StyledButtonProps> = ({
onPress,
text,
disabled = false,
buttonStyle = StyledButtonType.default
}) => {
const StyledButton: FC<StyledButtonProps> = ({ onPress, text, disabled = false, buttonStyle = StyledButtonType.default }) => {
const { colors } = useTheme();
const stylesHook = StyleSheet.create({
buttonGrey: {
@ -26,8 +21,8 @@ const StyledButton: FC<StyledButtonProps> = ({
color: colors.buttonTextColor,
},
container: {
opacity: disabled ? 0.5 : 1.0
}
opacity: disabled ? 0.5 : 1.0,
},
});
const textStyles = () => {
if (buttonStyle === StyledButtonType.grey) {