Skip to content

Commit

Permalink
Merge pull request #32790 from DylanDylann/fix/32080-copy-referral-li…
Browse files Browse the repository at this point in the history
…nk-is-not-actived

Fix/32080: Referral button is not focused
  • Loading branch information
stitesExpensify authored Dec 11, 2023
2 parents 298d9d2 + 1e3d9bc commit cf918b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/CopyTextToClipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ const propTypes = {
// eslint-disable-next-line react/forbid-prop-types
textStyles: PropTypes.arrayOf(PropTypes.object),
urlToCopy: PropTypes.string,
accessibilityRole: PropTypes.string,
...withLocalizePropTypes,
};

const defaultProps = {
textStyles: [],
urlToCopy: null,
accessibilityRole: undefined,
};

function CopyTextToClipboard(props) {
Expand All @@ -34,6 +36,7 @@ function CopyTextToClipboard(props) {
icon={Expensicons.Copy}
textStyles={props.textStyles}
onPress={copyToClipboard}
accessibilityRole={props.accessibilityRole}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Pressable/PressableWithDelayToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type PressableWithDelayToggleProps = PressableProps & {
* vertical text alignment of non-Text elements
*/
inline?: boolean;
accessibilityRole?: string;
};

function PressableWithDelayToggle(
Expand All @@ -63,6 +64,7 @@ function PressableWithDelayToggle(
textStyles,
iconStyles,
icon,
accessibilityRole,
}: PressableWithDelayToggleProps,
ref: PressableRef,
) {
Expand Down Expand Up @@ -101,6 +103,7 @@ function PressableWithDelayToggle(
onPress={updatePressState}
accessibilityLabel={tooltipTexts}
suppressHighlighting={inline ? true : undefined}
accessibilityRole={accessibilityRole}
>
<>
{inline && labelText}
Expand Down
1 change: 1 addition & 0 deletions src/pages/ReferralDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function ReferralDetailsPage({route, account}) {
{shouldShowClipboard && (
<View style={[styles.border, styles.pv2, styles.ph3, styles.mb6]}>
<CopyTextToClipboard
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
text={translate('referralProgram.copyReferralLink')}
textStyles={[styles.colorMuted]}
urlToCopy={generateReferralURL(account.primaryLogin)}
Expand Down

0 comments on commit cf918b6

Please sign in to comment.