Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing copy icons and social icons on Android #20528

Merged
merged 11 commits into from
Jun 14, 2023
3 changes: 2 additions & 1 deletion src/components/PressableWithDelayToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ function PressableWithDelayToggle(props) {
<>
<Text
suppressHighlighting
style={[styles.mr1, ...props.textStyles]}
style={props.textStyles}
>
{props.isDelayButtonStateComplete && props.textChecked ? props.textChecked : props.text}
&nbsp;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you replace mr1 with space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mr1 in this context doesn't work. That's why I replaced it with space

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok this regression came from another PR. But that's good to fix it here as it's simple.
Also I found another 2 regressions happening on production:

  • copy icon is not center aligned vertically
  • copy icon is not highlighted even though cursor changed to pointer changes to pointer
Screen.Recording.2023-06-13.at.11.48.27.AM.mov

This can be out of scope as it doesn't seem simple solution.
cc: @NikkiWines

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think it's fine to make those separate issues but please note it in the PR so that our QA team doesn't mark them as regressions from this PR. Once this is live, they should be reported as new bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR updated

</Text>
<Pressable
ref={props.innerRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function ContactMethodsPage(props) {
/>
<ScrollView>
<View style={[styles.ph5, styles.mv3, styles.flexRow, styles.flexWrap]}>
<Text>
<Text numberOfLines={100}>
{props.translate('contacts.helpTextBeforeEmail')}
<CopyTextToClipboard
text="receipts@expensify.com"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/SignInPageLayout/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function Footer(props) {
</Hoverable>
))}
{i === 2 && (
<View style={styles.mt5}>
<View style={styles.mt4}>
<Socials />
</View>
)}
Expand Down
44 changes: 23 additions & 21 deletions src/pages/signin/Socials.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react';
import {View} from 'react-native';
import _ from 'underscore';
import * as Link from '../../libs/actions/Link';
import Icon from '../../components/Icon';
import Text from '../../components/Text';
import PressableWithoutFeedback from '../../components/Pressable/PressableWithoutFeedback';
import * as Expensicons from '../../components/Icon/Expensicons';
import themeColors from '../../styles/themes/default';
import styles from '../../styles/styles';
import variables from '../../styles/variables';
import CONST from '../../CONST';
import Hoverable from '../../components/Hoverable';
import TextLink from '../../components/TextLink';

const socialsList = [
{
Expand All @@ -36,27 +35,30 @@ const socialsList = [

function Socials() {
return (
<Text>
<View style={[styles.flexRow, styles.flexWrap]}>
{_.map(socialsList, (social) => (
<Hoverable key={social.link}>
{(hovered) => (
<View>
<TextLink
style={styles.pr1}
href={social.link}
>
<Icon
src={social.iconURL}
height={variables.iconSizeLarge}
width={variables.iconSizeLarge}
fill={hovered ? themeColors.link : themeColors.textLight}
/>
</TextLink>
</View>
<PressableWithoutFeedback
key={social.link}
href={social.link}
onPress={(e) => {
e.preventDefault();
Link.openExternalLink(social.link);
}}
accessible={false}
style={[styles.mr1, styles.mt1]}
shouldUseAutoHitSlop={false}
>
{({hovered, pressed}) => (
<Icon
src={social.iconURL}
height={variables.iconSizeLarge}
width={variables.iconSizeLarge}
fill={hovered || pressed ? themeColors.link : themeColors.textLight}
/>
)}
</Hoverable>
</PressableWithoutFeedback>
))}
</Text>
</View>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/bills/WorkspaceBillsFirstSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function WorkspaceBillsFirstSection(props) {
containerStyles={[styles.cardSection]}
>
<View style={[styles.mv3]}>
<Text>
<Text numberOfLines={100}>
{props.translate('workspace.bills.askYourVendorsBeforeEmail')}
{props.user.isFromPublicDomain ? (
<TextLink onPress={() => Link.openExternalLink('https://community.expensify.com/discussion/7500/how-to-pay-your-company-bills-in-expensify/')}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/reimburse/WorkspaceReimburseView.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class WorkspaceReimburseView extends React.Component {
]}
>
<View style={[styles.mv3, styles.flexRow, styles.flexWrap]}>
<Text>
<Text numberOfLines={100}>
{this.props.translate('workspace.reimburse.captureNoVBACopyBeforeEmail')}
<CopyTextToClipboard
text="receipts@expensify.com"
Expand Down