Skip to content

Commit

Permalink
Merge pull request #224 from department-of-veterans-affairs/feature/2…
Browse files Browse the repository at this point in the history
…20-roettger-LinkVisualQAFixes

[Feature] Link - Visual QA Updates/Fixes
  • Loading branch information
TimRoe authored Mar 6, 2024
2 parents 1eaefb1 + 2a5dec3 commit 42e286b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/components/src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
TextProps,
TextStyle,
View,
ViewStyle,
} from 'react-native'
import React, { FC } from 'react'

Expand Down Expand Up @@ -212,9 +213,18 @@ export const Link: FC<LinkProps> = ({
linkColor = isDarkMode ? Colors.uswdsBlueVivid30 : Colors.primary
}

const iconViewStyle: ViewStyle = {
marginRight: 5, // Spacer to text
// Below keeps icon aligned with first row of text, centered, and scalable
alignSelf: 'flex-start',
minHeight: 30,
alignItems: 'center',
justifyContent: 'center',
}

const iconDisplay =
icon === 'no icon' ? null : (
<View style={{ marginRight: 5 }}>
<View style={iconViewStyle}>
<Icon fill={linkColor} {...icon} />
</View>
)
Expand All @@ -239,6 +249,7 @@ export const Link: FC<LinkProps> = ({

const pressableProps: PressableProps = {
onPress: _onPress,
hitSlop: 7,
...a11yProps,
style: {
flexDirection: 'row',
Expand Down

0 comments on commit 42e286b

Please sign in to comment.