mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 20:07:11 +01:00
Merge pull request #6400 from BlueWallet/buttontext
FIX: Some screens had Button styling was broken
This commit is contained in:
commit
d7f3579aee
2 changed files with 7 additions and 12 deletions
|
@ -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>
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue