mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-04 04:13:49 +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 = (
|
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.icon && <Icon name={props.icon.name} type={props.icon.type} color={props.icon.color} />}
|
||||||
{props.title && <Text style={textStyle}>{props.title}</Text>}
|
{props.title && <Text style={textStyle}>{props.title}</Text>}
|
||||||
</View>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
return props.onPress ? (
|
return props.onPress ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
ref={ref}
|
ref={ref}
|
||||||
testID={props.testID}
|
testID={props.testID}
|
||||||
style={[buttonStyle, props.style]}
|
style={[buttonStyle, props.style, styles.content]}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
onPress={props.onPress}
|
onPress={props.onPress}
|
||||||
disabled={props.disabled}
|
disabled={props.disabled}
|
||||||
|
@ -59,7 +59,7 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((props, ref) =>
|
||||||
{buttonView}
|
{buttonView}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : (
|
) : (
|
||||||
buttonView
|
<View style={[buttonStyle, props.style, styles.content]}>{buttonView}</View>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,7 @@ interface StyledButtonProps {
|
||||||
buttonStyle?: keyof typeof StyledButtonType;
|
buttonStyle?: keyof typeof StyledButtonType;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StyledButton: FC<StyledButtonProps> = ({
|
const StyledButton: FC<StyledButtonProps> = ({ onPress, text, disabled = false, buttonStyle = StyledButtonType.default }) => {
|
||||||
onPress,
|
|
||||||
text,
|
|
||||||
disabled = false,
|
|
||||||
buttonStyle = StyledButtonType.default
|
|
||||||
}) => {
|
|
||||||
const { colors } = useTheme();
|
const { colors } = useTheme();
|
||||||
const stylesHook = StyleSheet.create({
|
const stylesHook = StyleSheet.create({
|
||||||
buttonGrey: {
|
buttonGrey: {
|
||||||
|
@ -26,8 +21,8 @@ const StyledButton: FC<StyledButtonProps> = ({
|
||||||
color: colors.buttonTextColor,
|
color: colors.buttonTextColor,
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
opacity: disabled ? 0.5 : 1.0
|
opacity: disabled ? 0.5 : 1.0,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const textStyles = () => {
|
const textStyles = () => {
|
||||||
if (buttonStyle === StyledButtonType.grey) {
|
if (buttonStyle === StyledButtonType.grey) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue