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

chore: rename modal-named arguments/variables related to SendConfirmation #6454

Merged
merged 33 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a05b888
add initial structure for ReviewTransaction component
sviderock Jan 22, 2025
ec19eab
add contact item to the ReviewTransaction
sviderock Jan 22, 2025
e020751
add to ignorelist in knip for now
sviderock Jan 22, 2025
47c821a
Merge branch 'slava/new-review-screen-skeleton' into slava/add-contac…
sviderock Jan 22, 2025
38a9733
add component for total line
sviderock Jan 22, 2025
a1ba00b
use new ReviewTransaction component for SendConfirmation
sviderock Jan 22, 2025
346f24c
remove unused ReviewFrame component
sviderock Jan 22, 2025
be50ea4
remove unused ShortenedAddress component, move its function outside
sviderock Jan 22, 2025
ffad452
add translations
sviderock Jan 22, 2025
93e5d47
Merge branch 'slava/add-total-value-to-review' into slava/add-new-rev…
sviderock Jan 22, 2025
14a7a71
add more translations
sviderock Jan 22, 2025
b37fdbf
fix tests
sviderock Jan 22, 2025
0719a2c
fix translations being in a wrong place
sviderock Jan 22, 2025
7f69607
fix some values not being formatted
sviderock Jan 22, 2025
302c6af
Merge branch 'slava/add-total-value-to-review' into slava/add-new-rev…
sviderock Jan 22, 2025
07cb0fb
Merge branch 'main' into slava/add-total-value-to-review
sviderock Jan 23, 2025
9a1b08b
fix translations
sviderock Jan 23, 2025
c607567
fix test
sviderock Jan 23, 2025
851a2b5
Merge branch 'slava/add-total-value-to-review' into slava/add-new-rev…
sviderock Jan 23, 2025
a716663
fix snapshot and translation
sviderock Jan 23, 2025
dbe721a
fixes as per review
sviderock Jan 24, 2025
4ac4793
Merge branch 'main' into slava/add-total-value-to-review
sviderock Jan 24, 2025
a30c611
Merge branch 'slava/add-total-value-to-review' into slava/add-new-rev…
sviderock Jan 24, 2025
b4f3d43
update snapshot
sviderock Jan 24, 2025
9da3945
fix e2e and bad merge issues
sviderock Jan 24, 2025
994fbf9
fix as per review
sviderock Jan 24, 2025
0b3e84c
Merge branch 'main' into slava/add-total-value-to-review
sviderock Jan 24, 2025
6e3b7d9
Merge branch 'slava/add-total-value-to-review' into slava/add-new-rev…
sviderock Jan 24, 2025
b7b2bab
Merge branch 'main' into slava/add-new-review-to-send-flow
sviderock Jan 27, 2025
e6b32bb
fix most issues as per review besides renaming fromModal
sviderock Jan 27, 2025
7b12103
revert fromModal change
sviderock Jan 27, 2025
6a7c281
rename fromModal to fromExternal
sviderock Jan 27, 2025
b7a7e6a
Merge branch 'main' into slava/rename-send-confirmation-modal
sviderock Jan 27, 2025
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
22 changes: 12 additions & 10 deletions e2e/src/usecases/HandleDeepLinkSend.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const launchDeepLink = async ({ url, newInstance = true }) => {
* @returns {Promise<string>}
*/
const getCryptoSymbol = async () => {
const sendAmountCryptoElement = await element(by.id('SendAmount')).getAttributes()
const sendAmountCryptoElement = await element(
by.id('SendConfirmationToken/PrimaryValue')
).getAttributes()
return sendAmountCryptoElement.label.split(' ').at(-1)
}

Expand All @@ -41,11 +43,11 @@ export default HandleDeepLinkSend = () => {
jestExpect(cryptoSymbol).toBe('cUSD')

// Fiat amount should match value passed in deeplink
await waitFor(element(by.id('SendAmountFiat')))
await waitFor(element(by.id('SendConfirmationToken/SecondaryValue')))
.toHaveText('$0.01')
.withTimeout(10 * 1000)

await waitFor(element(by.id('DisplayName')))
await waitFor(element(by.id('SendConfirmationRecipient/PrimaryValue')))
.toHaveText('TestFaucet')
.withTimeout(10 * 1000)

Expand Down Expand Up @@ -87,7 +89,7 @@ export default HandleDeepLinkSend = () => {
await launchDeepLink({
url: deepLinks.withoutAddress,
})
await expect(element(by.id('SendAmount'))).not.toBeVisible()
await expect(element(by.id('SendConfirmationToken/PrimaryValue'))).not.toBeVisible()
})
})

Expand All @@ -105,11 +107,11 @@ export default HandleDeepLinkSend = () => {
jestExpect(cryptoSymbol).toBe('cUSD')

// Fiat amount should match value passed in deeplink
await waitFor(element(by.id('SendAmountFiat')))
await waitFor(element(by.id('SendConfirmationToken/SecondaryValue')))
.toHaveText('$0.01')
.withTimeout(10 * 1000)

await waitFor(element(by.id('DisplayName')))
await waitFor(element(by.id('SendConfirmationRecipient/PrimaryValue')))
.toHaveText('TestFaucet')
.withTimeout(10 * 1000)

Expand All @@ -125,7 +127,7 @@ export default HandleDeepLinkSend = () => {

it('Then should error if no address provided', async () => {
await launchDeepLink({ url: deepLinks.withoutAddress, newInstance: false })
await expect(element(by.id('SendAmount'))).not.toBeVisible()
await expect(element(by.id('SendConfirmationToken/PrimaryValue'))).not.toBeVisible()
})
})

Expand All @@ -138,11 +140,11 @@ export default HandleDeepLinkSend = () => {
jestExpect(cryptoSymbol).toBe('cUSD')

// Fiat amount should match value passed in deeplink
await waitFor(element(by.id('SendAmountFiat')))
await waitFor(element(by.id('SendConfirmationToken/SecondaryValue')))
.toHaveText('$0.01')
.withTimeout(10 * 1000)

await waitFor(element(by.id('DisplayName')))
await waitFor(element(by.id('SendConfirmationRecipient/PrimaryValue')))
.toHaveText('TestFaucet')
.withTimeout(10 * 1000)

Expand All @@ -158,7 +160,7 @@ export default HandleDeepLinkSend = () => {

it('Then should error if no address provided', async () => {
await openDeepLink(deepLinks.withoutAddress)
await expect(element(by.id('SendAmount'))).not.toBeVisible()
await expect(element(by.id('SendConfirmationToken/PrimaryValue'))).not.toBeVisible()
})
})

Expand Down
6 changes: 3 additions & 3 deletions e2e/src/usecases/Send.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default Send = () => {
})

it('Then should display correct recipient', async () => {
await expect(element(by.text(recipientAddressDisplay))).toBeVisible()
await expect(element(by.text(DEFAULT_RECIPIENT_ADDRESS))).toBeVisible()
})

it('Then should be able to edit amount', async () => {
Expand All @@ -93,7 +93,7 @@ export default Send = () => {
timeout: 30_000,
tap: true,
})
let amount = await element(by.id('SendAmount')).getAttributes()
let amount = await element(by.id('SendConfirmationToken/PrimaryValue')).getAttributes()
jestExpect(amount.text).toEqual('0.01 cEUR')
})

Expand Down Expand Up @@ -143,7 +143,7 @@ export default Send = () => {
})

it('Then should display correct recipient', async () => {
await expect(element(by.text(recipientAddressDisplay))).toBeVisible()
await expect(element(by.text(DEFAULT_RECIPIENT_ADDRESS))).toBeVisible()
})

it('Then should be able to send', async () => {
Expand Down
3 changes: 3 additions & 0 deletions locales/base/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2847,10 +2847,13 @@
"ctaAction_Withdraw": "Withdraw smaller amount"
},
"reviewTransaction": {
"title": "Review Send",
"totalPlusFees": "Total Plus Fees",
"multipleTokensWithPlusSign": "≈ {{amount1}} {{symbol1}} + {{amount2}} {{symbol2}}"
},
"tokenAmount": "{{tokenAmount}} {{tokenSymbol}}",
"localAmount": "{{localCurrencySymbol}}{{localAmount}}",
"localAmount_noFiatPrice": "Price Unavailable",
"tokenAndLocalAmount": "{{tokenAmount}} {{tokenSymbol}} <0>({{localCurrencySymbol}}{{localAmount}})</0>",
"tokenAmountApprox": "≈ {{tokenAmount}} {{tokenSymbol}}",
"localAmountApprox": "≈ {{localCurrencySymbol}}{{localAmount}}",
Expand Down
4 changes: 4 additions & 0 deletions src/account/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ export function getPhoneNumberDetails(
}
}
}

export function formatShortenedAddress(address: string): string {
return `${address.slice(0, 6)}...${address.slice(-4)}`
}
2 changes: 1 addition & 1 deletion src/components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as React from 'react'
import { WithTranslation } from 'react-i18next'
import { StyleSheet, Text, TextStyle, View } from 'react-native'
import { defaultCountryCodeSelector } from 'src/account/selectors'
import { formatShortenedAddress } from 'src/account/utils'
import ContactCircle from 'src/components/ContactCircle'
import PhoneNumberWithFlag from 'src/components/PhoneNumberWithFlag'
import { formatShortenedAddress } from 'src/components/ShortenedAddress'
import { withTranslation } from 'src/i18n'
import { Recipient, getDisplayName } from 'src/recipients/recipient'
import { useSelector } from 'src/redux/hooks'
Expand Down
44 changes: 0 additions & 44 deletions src/components/ReviewFrame.test.tsx

This file was deleted.

140 changes: 0 additions & 140 deletions src/components/ReviewFrame.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/ShortenedAddress.tsx

This file was deleted.

Loading
Loading