Skip to content

Commit

Permalink
fix: button styling for native (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyadeorukhkar authored Aug 3, 2022
1 parent bbb621b commit 17b2c71
Show file tree
Hide file tree
Showing 7 changed files with 395 additions and 246 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-spies-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade": patch
---

fix: button styling for native
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const getProps = ({
fontSize: buttonTypographyTokens.fonts.size[size],
lineHeight: buttonTypographyTokens.lineHeights[size],
minHeight: makeSize(buttonMinHeight[size]),
iconPadding: hasIcon ? `spacing.${textPadding[size]}` : undefined,
iconPadding: hasIcon && children?.trim() ? `spacing.${textPadding[size]}` : undefined,
iconColor: getColorToken({
property: 'icon',
variant,
Expand Down Expand Up @@ -354,7 +354,7 @@ const BaseButton = ({
flexDirection="row"
alignItems="center"
justifyContent="center"
alignSelf="center"
flex={1}
isHidden={isLoading}
>
{Icon && iconPosition == 'left' ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { useTheme } from '~components/BladeProvider';

const StyledPressable = styled(Animated.createAnimatedComponent(Pressable))<
Omit<StyledBaseButtonProps, 'onClick' | 'accessibilityProps'>
>((props) => getStyledBaseButtonStyles(props));
>((props) => ({
...getStyledBaseButtonStyles(props),
alignSelf: 'center',
}));

const StyledBaseButton = ({
onClick,
Expand Down
Loading

0 comments on commit 17b2c71

Please sign in to comment.