Skip to content

Commit

Permalink
Merge pull request #5746 from Santhosh-Sellavel/santhosh_copy_email_o…
Browse files Browse the repository at this point in the history
…ptions_enable

Copy Option Enabled for small screen devices also
  • Loading branch information
Luke9389 authored Oct 19, 2021
2 parents 86d3ec9 + 678175d commit d0c166e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
63 changes: 31 additions & 32 deletions src/components/CommunicationsLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,37 @@ const defaultProps = {

const CommunicationsLink = props => (
<View style={[styles.flexRow, styles.pRelative, ...props.containerStyles]}>
{props.isSmallScreenWidth
? (
<Pressable
style={styles.mw100}
onPress={() => Linking.openURL(
props.type === CONST.LOGIN_TYPE.PHONE
? `tel:${props.value}`
: `mailto:${props.value}`,
)}
>
{props.children}
</Pressable>
) : (
<View style={[
styles.flexRow,
styles.alignItemsCenter,
styles.w100,
styles.communicationsLinkHeight,
]}
>
{props.children}
<ContextMenuItem
icon={ClipboardIcon}
text={props.translate('reportActionContextMenu.copyToClipboard')}
successIcon={Checkmark}
successText={props.translate('reportActionContextMenu.copied')}
isMini
autoReset
onPress={() => Clipboard.setString(props.value)}
/>
</View>
)}
<View style={[
styles.flexRow,
styles.alignItemsCenter,
styles.w100,
styles.communicationsLinkHeight,
]}
>
<View style={styles.flexShrink1}>
{props.isSmallScreenWidth
? (
<Pressable
onPress={() => Linking.openURL(
props.type === CONST.LOGIN_TYPE.PHONE
? `tel:${props.value}`
: `mailto:${props.value}`,
)}
>
{props.children}
</Pressable>
) : props.children}
</View>
<ContextMenuItem
icon={ClipboardIcon}
text={props.translate('reportActionContextMenu.copyToClipboard')}
successIcon={Checkmark}
successText={props.translate('reportActionContextMenu.copied')}
isMini
autoReset
onPress={() => Clipboard.setString(props.value)}
/>
</View>
</View>
);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const DetailsPage = ({
type={isSMSLogin ? CONST.LOGIN_TYPE.PHONE : CONST.LOGIN_TYPE.EMAIL}
value={isSMSLogin ? getPhoneNumber(details) : details.login}
>
<Text numberOfLines={1} style={[styles.w100]}>
<Text numberOfLines={1}>
{isSMSLogin
? toLocalPhone(getPhoneNumber(details))
: details.login}
Expand Down

0 comments on commit d0c166e

Please sign in to comment.