Skip to content

Commit

Permalink
Merge pull request #4154 from Expensify/cmartins-email-copy
Browse files Browse the repository at this point in the history
Fix copy to clipboard in long emails
  • Loading branch information
sketchydroide authored Jul 26, 2021
2 parents 48bf2f5 + e5974e6 commit c52f9f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
13 changes: 6 additions & 7 deletions src/components/CommunicationsLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ const CommunicationsLink = props => (
>
{props.children}
</Pressable>
)
: props.children}
{!props.isSmallScreenWidth
&& (
) : (
<View style={[
styles.pAbsolute,
styles.flexRow,
styles.alignItemsCenter,
styles.justifyContentCenter,
styles.communicationsLinkIcon]}
styles.w100,
styles.communicationsLinkHeight,
]}
>
{props.children}
<ContextMenuItem
icon={ClipboardIcon}
text={props.translate('contextMenuItem.copyToClipboard')}
Expand Down
23 changes: 6 additions & 17 deletions src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,13 @@ const DetailsPage = ({
imageStyles={[styles.avatarLarge]}
source={details.avatar}
/>
{details.displayName && isSMSLogin
? (
<CommunicationsLink
style={[styles.mt1, styles.mb6]}
type={CONST.LOGIN_TYPE.PHONE}
value={getPhoneNumber(details)}
>
<Text style={[styles.displayName]} numberOfLines={1}>
{toLocalPhone(details.displayName)}
</Text>
</CommunicationsLink>
) : (
<Text style={[styles.displayName]} numberOfLines={1}>
{details.displayName || null}
</Text>
)}
{details.displayName && (
<Text style={[styles.displayName, styles.mb6]} numberOfLines={1}>
{isSMSLogin ? toLocalPhone(details.displayName) : details.displayName}
</Text>
)}
{details.login ? (
<View style={[styles.mb6, styles.detailsPageSectionContainer]}>
<View style={[styles.mb6, styles.detailsPageSectionContainer, styles.w100]}>
<Text style={[styles.formLabel, styles.mb2]} numberOfLines={1}>
{translate(isSMSLogin
? 'common.phoneNumber'
Expand Down
6 changes: 2 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1798,10 +1798,8 @@ const styles = {
...whiteSpace.noWrap,
},

communicationsLinkIcon: {
right: -36,
top: 0,
bottom: 0,
communicationsLinkHeight: {
height: 20,
},
};

Expand Down

0 comments on commit c52f9f5

Please sign in to comment.