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

Feature/confusables #2464

Merged
merged 28 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dccf63b
Add confusable warning to SendTo
rickycodes Mar 31, 2021
a911d0e
Highlight confusable characters
rickycodes Mar 31, 2021
4bfca9d
Replace zeroWidthPoints characters with ?
rickycodes Mar 31, 2021
bfc1883
Add some notes
rickycodes Mar 31, 2021
29a101c
Add confusable highlight to confirm screen
rickycodes Mar 31, 2021
faa58da
Update checkZeroWidth function
rickycodes Mar 31, 2021
a688d78
Add exclamation mark to Confirm
rickycodes Mar 31, 2021
38a4db9
Add handleConfusables method
rickycodes Mar 31, 2021
13debfa
Move this into one spot
rickycodes Mar 31, 2021
a619a5d
Add hasZeroWidthPoints
rickycodes Apr 1, 2021
e99798e
Rename T to Texts
rickycodes Apr 1, 2021
d9cebac
Use reduce
rickycodes Apr 1, 2021
b0296fb
Add homoglyphic tests
rickycodes Apr 1, 2021
e7dfa57
Add Modal for confusable on confirm screen
rickycodes Apr 1, 2021
7f4ba86
Update snapshot
rickycodes Apr 1, 2021
1fbbf56
Use Swaps InfoModal
rickycodes Apr 1, 2021
1211a92
Increase lineheight on modals
rickycodes Apr 1, 2021
39e7a46
Only display warning if address is not in addressBook
rickycodes Apr 1, 2021
f65dd5a
Update snapshot
rickycodes Apr 1, 2021
89284fc
Make texts lowercase
rickycodes Apr 8, 2021
def68ea
Remove unused state
rickycodes Apr 8, 2021
e7d7335
Add patch
andrepimenta Apr 14, 2021
12ca98d
Display as warning in yelllow when not zero width
rickycodes Apr 26, 2021
192bba5
Only display confusables warnings if the user is not in addressbook
rickycodes Apr 26, 2021
a7237a2
Add optional chaining for addressBook
rickycodes Apr 26, 2021
0b76634
Merge branch 'develop' into feature/confusables
rickycodes Apr 27, 2021
d6ca8b6
Merge branch 'develop' into feature/confusables
rickycodes Apr 29, 2021
12e9c7a
Merge branch 'develop' into feature/confusables
rickycodes Apr 29, 2021
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
13 changes: 12 additions & 1 deletion app/components/Base/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ const style = StyleSheet.create({
right: {
textAlign: 'right'
},
bold: fontStyles.bold,
red: {
color: colors.red
},
black: {
color: colors.black
},
bold: fontStyles.bold,
blue: {
color: colors.blue
},
Expand Down Expand Up @@ -66,6 +69,7 @@ const Text = ({
green,
black,
blue,
red,
primary,
small,
upper,
Expand All @@ -87,6 +91,8 @@ const Text = ({
green && style.green,
black && style.black,
blue && style.blue,
red && style.red,
black && style.black,
primary && style.primary,
disclaimer && [style.small, style.disclaimer],
small && style.small,
Expand All @@ -110,6 +116,7 @@ Text.defaultProps = {
green: false,
black: false,
blue: false,
red: false,
primary: false,
disclaimer: false,
modal: false,
Expand Down Expand Up @@ -150,6 +157,10 @@ Text.propTypes = {
* Makes text blue
*/
blue: PropTypes.bool,
/**
* Makes text red
*/
red: PropTypes.bool,
/**
* Makes text fontPrimary color
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -55,6 +56,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -83,6 +85,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand All @@ -109,6 +112,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand All @@ -132,6 +136,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
noMargin={true}
onPress={[Function]}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -174,6 +179,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={true}
Expand All @@ -199,6 +205,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={true}
small={false}
Expand Down Expand Up @@ -232,6 +239,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={true}
Expand All @@ -257,6 +265,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={true}
small={false}
Expand Down Expand Up @@ -289,6 +298,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={false}
small={true}
Expand All @@ -314,6 +324,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={true}
red={false}
reset={false}
right={true}
small={false}
Expand Down Expand Up @@ -350,6 +361,7 @@ exports[`AddCustomNetwork should render correctly 1`] = `
modal={false}
noMargin={true}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`AssetActionButtons should render correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -97,6 +98,7 @@ exports[`AssetActionButtons should render type add correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -154,6 +156,7 @@ exports[`AssetActionButtons should render type information correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -211,6 +214,7 @@ exports[`AssetActionButtons should render type receive correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -268,6 +272,7 @@ exports[`AssetActionButtons should render type send correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -325,6 +330,7 @@ exports[`AssetActionButtons should render type swap correctly 1`] = `
modal={false}
numberOfLines={1}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -150,6 +151,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand All @@ -176,6 +178,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -280,6 +283,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -309,6 +313,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -336,6 +341,7 @@ exports[`CustomNonceModal should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ exports[`ReceiveRequest should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -70,6 +71,7 @@ exports[`ReceiveRequest should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -104,6 +106,7 @@ exports[`ReceiveRequest should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand All @@ -126,6 +129,7 @@ exports[`ReceiveRequest should render correctly 1`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={true}
Expand Down
9 changes: 6 additions & 3 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ const styles = StyleSheet.create({
termsButton: {
marginTop: 10,
marginBottom: 6
},
text: {
lineHeight: 20
}
});

Expand Down Expand Up @@ -1303,20 +1306,20 @@ function SwapsQuotesView({
isVisible={isUpdateModalVisible}
toggleModal={toggleUpdateModal}
title={strings('swaps.quotes_update_often')}
body={<Text>{strings('swaps.quotes_update_often_text')}</Text>}
body={<Text style={styles.text}>{strings('swaps.quotes_update_often_text')}</Text>}
/>
<InfoModal
isVisible={isPriceDifferenceModalVisible}
toggleModal={togglePriceDifferenceModal}
title={strings('swaps.price_difference_title')}
body={<Text>{strings('swaps.price_difference_body')}</Text>}
body={<Text style={styles.text}>{strings('swaps.price_difference_body')}</Text>}
/>
<InfoModal
isVisible={isFeeModalVisible}
toggleModal={toggleFeeModal}
title={strings('swaps.metamask_swap_fee')}
body={
<Text>
<Text style={styles.text}>
{strings('swaps.fee_text.get_the')} <Text bold>{strings('swaps.fee_text.best_price')}</Text>{' '}
{strings('swaps.fee_text.from_the')} <Text bold>{strings('swaps.fee_text.top_liquidity')}</Text>{' '}
{strings('swaps.fee_text.fee_is_applied', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports[`TokenIcon component should Render correctly 3`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -134,6 +135,7 @@ exports[`TokenIcon component should Render correctly 7`] = `
link={false}
modal={false}
primary={false}
red={false}
reset={false}
right={false}
small={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`TokenSelectButton component should Render correctly 1`] = `
link={false}
modal={false}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -96,6 +97,7 @@ exports[`TokenSelectButton component should Render correctly 2`] = `
link={false}
modal={false}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -158,6 +160,7 @@ exports[`TokenSelectButton component should Render correctly 3`] = `
link={false}
modal={false}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -221,6 +224,7 @@ exports[`TokenSelectButton component should Render correctly 4`] = `
link={false}
modal={false}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down Expand Up @@ -286,6 +290,7 @@ exports[`TokenSelectButton component should Render correctly 5`] = `
link={false}
modal={false}
primary={true}
red={false}
reset={false}
right={false}
small={false}
Expand Down
Loading