Skip to content

Commit

Permalink
[PAY-2426] Fix native harmony text and buttons (#7528)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Feb 8, 2024
1 parent fb49bc6 commit 80a170c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const Button = (props: ButtonProps) => {
type,
color: themeColors,
cornerRadius,
shadows,
spacing,
typography
} = useTheme()
Expand All @@ -46,10 +45,10 @@ export const Button = (props: ButtonProps) => {
height: spacing.unit8,
paddingHorizontal: spacing.m
}
// title-s-default
const smallTextStyles: TextStyle = {
fontFamily: typography.fontByWeight.bold,
fontSize: typography.size.s,
fontWeight: `${typography.weight.bold}` as TextStyle['fontWeight'],
lineHeight: typography.lineHeight.s,
textTransform: 'capitalize'
}
Expand All @@ -59,10 +58,11 @@ export const Button = (props: ButtonProps) => {
height: spacing.unit12,
paddingHorizontal: spacing.xl
}

// title-l-default
const defaultTextStyles: TextStyle = {
fontFamily: typography.fontByWeight.bold,
fontSize: typography.size.l,
fontWeight: `${typography.weight.bold}` as TextStyle['fontWeight'],
lineHeight: typography.lineHeight.l,
textTransform: 'capitalize'
}
Expand All @@ -72,10 +72,10 @@ export const Button = (props: ButtonProps) => {
height: spacing.unit16,
paddingHorizontal: spacing.xl
}

const largeTextStyles: TextStyle = {
fontFamily: typography.fontByWeight.bold,
fontSize: typography.size.xl,
fontWeight: `${typography.weight.bold}` as TextStyle['fontWeight'],
lineHeight: typography.lineHeight.l,
letterSpacing: 0.25,
textTransform: 'uppercase'
Expand Down Expand Up @@ -204,7 +204,8 @@ export const Button = (props: ButtonProps) => {
borderRadius: cornerRadius.s,
alignItems: 'center',
justifyContent: 'center',
...shadows.near,
// TODO bring this back properly
// ...shadows.near,
...(variant === 'secondary'
? secondaryStyles
: variant === 'tertiary'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const Text = forwardRef<TextBase, TextProps>((props, ref) => {
...(variantStyles && {
fontSize: t.size[variantStyles.fontSize[size]],
lineHeight: t.lineHeight[variantStyles.lineHeight[size]],
fontWeight: t.weight[variantStyles.fontWeight[strength]],
fontFamily: t.fontByWeight[variantStyles.fontWeight[strength]],
...('css' in variantStyles ? variantStyles.css : {})
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export const TextInput = forwardRef(
shadowOpacity={0.05}
shadowColor='#000000'
shadowRadius={4}
elevation={2}
>
<AnimatedFlex
h='100%'
Expand Down Expand Up @@ -334,7 +335,10 @@ export const TextInput = forwardRef(
underlineColorAndroid='transparent'
aria-label={ariaLabel ?? labelText}
style={css({
flex: 1,
// Need absolute height to ensure consistency across platforms
height: !isSmall ? 23 : undefined,
// Android has a default padding that needs to be removed
paddingVertical: 0,
fontSize: typography.size[isSmall ? 's' : 'l'],
fontFamily: typography.fontByWeight.medium,
color: color.text[disabled ? 'subdued' : 'default']
Expand Down

0 comments on commit 80a170c

Please sign in to comment.