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 style copy button #21698

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions src/pages/settings/Security/TwoFactorAuth/CodesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Clipboard from '../../../../libs/Clipboard';
import themeColors from '../../../../styles/themes/default';
import localFileDownload from '../../../../libs/localFileDownload';
import * as TwoFactorAuthActions from '../../../../libs/actions/TwoFactorAuthActions';
import * as StyleUtils from '../../../../styles/StyleUtils';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -96,9 +95,9 @@ function CodesPage(props) {
</Text>
))}
</View>
<View style={[styles.twoFactorAuthCodesButtonsContainer, StyleUtils.getWrappingStyle(props.isExtraSmallScreenWidth)]}>
<View style={[styles.twoFactorAuthCodesButtonsContainer]}>
<PressableWithDelayToggle
text={props.translate('twoFactorAuth.copyCodes')}
aldo-expensify marked this conversation as resolved.
Show resolved Hide resolved
text={props.translate('twoFactorAuth.copy')}
textChecked={props.translate('common.copied')}
icon={Expensicons.Copy}
inline={false}
Expand Down
13 changes: 7 additions & 6 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2165,14 +2165,14 @@ const styles = {
},

twoFactorAuthCodesBox: ({isExtraSmallScreenWidth, isSmallScreenWidth}) => {
let paddingHorizontal = styles.ph15;
let paddingHorizontal = styles.ph9;

if (isSmallScreenWidth) {
paddingHorizontal = styles.ph10;
paddingHorizontal = styles.ph4;
}

if (isExtraSmallScreenWidth) {
paddingHorizontal = styles.ph4;
paddingHorizontal = styles.ph2;
}

return {
Expand All @@ -2198,12 +2198,12 @@ const styles = {
flexDirection: 'row',
flexWrap: 'wrap',
gap: 12,
height: 148,
minHeight: 148,
Copy link
Contributor

Choose a reason for hiding this comment

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

Question, why do we need a minHeight or height? Is it possible to let the container have the height defined by the content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, think again agree @aldo-expensify , We can don't need set height or minHeight.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Work well from web, native (android and ios)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-06-30 at 05 16 07 Screenshot 2023-06-30 at 05 25 06
Screen.Recording.2023-06-30.at.05.22.29.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm yeah, I thought this is made to make it look nice when no code is loaded, i.e. loading the spinner but the spinner uses it own View with a fixed height already.

Copy link
Contributor

Choose a reason for hiding this comment

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

No we should only show the spinner if we are actually loading something. But in what cases no code is loaded (and the spinner is not loading either)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we only need to remove minHeight and height. @aldo-expensify What do you think about this, if we come to the conclusion I will update the PR right away for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

But in what cases no code is loaded (and the spinner is not loading either)

No cases? 🤷

So we only need to remove minHeight and height. @aldo-expensify What do you think about this, if we come to the conclusion I will update the PR right away for this.

I guess that sounds fine. Sounds good to you @s77rt ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes sounds good to me 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah thanks, The PR has been updated. cc @s77rt @aldo-expensify

},

twoFactorAuthCode: {
fontFamily: fontFamily.MONOSPACE,
width: 100,
width: 112,
textAlign: 'center',
},

Expand All @@ -2212,10 +2212,11 @@ const styles = {
justifyContent: 'center',
gap: 12,
marginTop: 20,
flexWrap: 'wrap',
},

twoFactorAuthCodesButton: {
minWidth: 140,
minWidth: 112,
},

twoFactorAuthCopyCodeButton: {
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utilities/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ export default {
paddingHorizontal: 32,
},

ph9: {
paddingHorizontal: 36,
},

ph10: {
paddingHorizontal: 40,
},
Expand Down