Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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