From 3b6453ddfd5198aa058d4705068c411120f89f47 Mon Sep 17 00:00:00 2001 From: Tim R Date: Tue, 5 Mar 2024 17:10:32 -0600 Subject: [PATCH 1/2] Update press target to 44px tall --- packages/components/src/components/Link/Link.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/src/components/Link/Link.tsx b/packages/components/src/components/Link/Link.tsx index 13deb486..616f4438 100644 --- a/packages/components/src/components/Link/Link.tsx +++ b/packages/components/src/components/Link/Link.tsx @@ -239,6 +239,7 @@ export const Link: FC = ({ const pressableProps: PressableProps = { onPress: _onPress, + hitSlop: 7, ...a11yProps, style: { flexDirection: 'row', From 95c5deb5e13a8e10bbc11532fd056e3791e4198b Mon Sep 17 00:00:00 2001 From: Tim R Date: Tue, 5 Mar 2024 18:31:44 -0600 Subject: [PATCH 2/2] Aligning icon to top row of link for long text --- packages/components/src/components/Link/Link.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/Link/Link.tsx b/packages/components/src/components/Link/Link.tsx index 616f4438..41182417 100644 --- a/packages/components/src/components/Link/Link.tsx +++ b/packages/components/src/components/Link/Link.tsx @@ -7,6 +7,7 @@ import { TextProps, TextStyle, View, + ViewStyle, } from 'react-native' import React, { FC } from 'react' @@ -212,9 +213,18 @@ export const Link: FC = ({ 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 : ( - + )