Skip to content

Commit

Permalink
CM-716 - Rename Coins to Tokens in all widgets (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoloaiza authored Jun 12, 2024
1 parent a3bc7b1 commit 64da48f
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('SelectForm', () => {
},
]}
onSelectChange={() => {}}
coinSelectorHeading="Select coin"
coinSelectorHeading="Select token"
selectedOption="imx"
defaultTokenImage="default-token-image"
/>
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('SelectForm', () => {
},
]}
onSelectChange={() => {}}
coinSelectorHeading="Select coin"
coinSelectorHeading="Select token"
defaultTokenImage="default-token-image"
/>
</ViewContextTestComponent>,
Expand All @@ -64,7 +64,7 @@ describe('SelectForm', () => {
cySmartGet('select-form-test-coin-selector__option-eth').should('exist');
});

it('should show select coin when no selected option', () => {
it('should show select token when no selected option', () => {
mount(
<ViewContextTestComponent>
<SelectForm
Expand All @@ -84,42 +84,42 @@ describe('SelectForm', () => {
},
]}
onSelectChange={() => {}}
coinSelectorHeading="Select coin"
coinSelectorHeading="Select token"
defaultTokenImage="default-token-image"
/>
</ViewContextTestComponent>,
);
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select coin');
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select token');
});

it('should show select coin when options is empty', () => {
it('should show select token when options is empty', () => {
mount(
<ViewContextTestComponent>
<SelectForm
testId="select-form-test"
options={[]}
onSelectChange={() => {}}
coinSelectorHeading="Select coin"
coinSelectorHeading="Select token"
defaultTokenImage="default-token-image"
/>
</ViewContextTestComponent>,
);
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select coin');
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select token');
});

it('should show select coin when selected option not in options list', () => {
it('should show Select token when selected option not in options list', () => {
mount(
<ViewContextTestComponent>
<SelectForm
testId="select-form-test"
options={[]}
onSelectChange={() => {}}
coinSelectorHeading="Select coin"
coinSelectorHeading="Select token"
selectedOption="imx"
defaultTokenImage="default-token-image"
/>
</ViewContextTestComponent>,
);
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select coin');
cySmartGet('select-form-test-select__target__label').should('have.text', 'Select token');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function SelectForm({
<Select
testId={`${testId}-select`}
size="large"
defaultLabel="Select coin"
defaultLabel="Select token"
targetClickOveride={() => setCoinSelectorOpen(true)}
selectedOption={getSelectedOption()}
sx={{ minw: '170px' }}
Expand Down
67 changes: 35 additions & 32 deletions packages/checkout/widgets-lib/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"CONNECT_WALLET": {
"body": {
"heading": "Connect a wallet",
"content": "You'll need to connect or create a digital wallet to buy, sell, trade and store your coins and collectibles."
"content": "You'll need to connect or create a digital wallet to buy, sell, trade and store your tokens and collectibles."
},
"walletSelection": {
"heading": "Choose a wallet"
Expand Down Expand Up @@ -87,13 +87,13 @@
"heading": "Network"
},
"totalTokenBalance": {
"heading": "Coins",
"heading": "Tokens",
"totalHeading": "Value"
},
"tokenBalancesList": {
"noTokensFound": "No tokens found"
},
"addCoins": "Add coins"
"addCoins": "Add tokens"
},
"SETTINGS": {
"header": {
Expand All @@ -112,19 +112,19 @@
},
"COIN_INFO": {
"metamask": {
"heading": "Coins and collectibles are native to networks",
"body": "You can switch networks to add coins or move them from one network to another"
"heading": "Tokens and collectibles are native to networks",
"body": "You can switch networks to add tokens or move them from one network to another"
},
"passport": {
"heading": "Coins and collectibles are native to networks",
"body1": "This network is called Immutable zkEVM. If you have other coins in your Passport and can’t see them here, they might be on another network. ",
"heading": "Tokens and collectibles are native to networks",
"body1": "This network is called Immutable zkEVM. If you have other tokens in your Passport and can’t see them here, they might be on another network. ",
"body2": " for more info.",
"linkText": "Visit our FAQs"
}
},
"SWAP": {
"header": {
"title": "Swap coins"
"title": "Swap tokens"
},
"content": {
"title": "What would you like to swap?",
Expand All @@ -151,8 +151,8 @@
"validation": {
"noAmountInputted": "Please input amount",
"insufficientBalance": "Insufficient balance",
"noFromTokenSelected": "Select a coin to swap",
"noToTokenSelected": "Select a coin to receive"
"noFromTokenSelected": "Select a token to swap",
"noToTokenSelected": "Select a token to receive"
},
"success": {
"text": "Success",
Expand Down Expand Up @@ -205,7 +205,7 @@
},
"ONRAMP": {
"header": {
"title": "Add coins"
"title": "Add tokens"
},
"initialLoadingText": "Taking you to Transak",
"IN_PROGRESS_LOADING": {
Expand All @@ -221,7 +221,7 @@
}
},
"SUCCESS": {
"text": "Coins are on the way",
"text": "Tokens are on the way",
"actionText": "Done"
},
"FAIL": {
Expand All @@ -234,6 +234,9 @@
"title": "How would you like to add tokens?"
},
"topUpOptions": {
"onramp": {
"heading": "Buy tokens"
},
"debit": {
"heading": "Buy with Debit Card",
"caption": "The recommended way to buy tokens",
Expand Down Expand Up @@ -279,7 +282,7 @@
},
"coinsDrawer": {
"header": "Pay with...",
"caption1": "Coins",
"caption1": "Tokens",
"caption2": "Balance",
"divider": "More options",
"stepType": {
Expand Down Expand Up @@ -319,7 +322,7 @@
},
"fundingRouteSelect": {
"heading": "Pay with your",
"noRoutesAvailable": "Insufficient coin balance. Please proceed with card instead.",
"noRoutesAvailable": "Insufficient token balance. Please proceed with card instead.",
"continue": "Continue",
"payWithCardInstead": "No thanks, I'll pay with card",
"payWithCard": "Pay with card"
Expand All @@ -331,19 +334,19 @@
},
"options": {
"crypto": {
"heading": "Coins",
"caption": "Pay with the coins in your wallet, or buy coins with card",
"heading": "Tokens",
"caption": "Pay with the tokens in your wallet, or buy tokens with card",
"disabledCaption": "Currently not available for this purchase"
},
"debit": {
"heading": "Debit Card",
"caption": "The recommended way to pay with card.",
"disabledCaption": "Unavailable for your selection. We recommend adding coins"
"disabledCaption": "Unavailable for your selection. We recommend adding tokens"
},
"credit": {
"heading": "Credit Card",
"caption": "Not recommended since transactions may be blocked by your bank.",
"disabledCaption": "Unavailable for your selection. We recommend adding coins"
"disabledCaption": "Unavailable for your selection. We recommend adding tokens"
}
},
"topUp": {
Expand Down Expand Up @@ -371,7 +374,7 @@
"PAY_WITH_COINS": {
"header": {
"heading": "Pay with your",
"caption": "Using the coins balance in your wallet"
"caption": "Using the token balance in your wallet"
},
"button": {
"buyNow": "Buy now"
Expand Down Expand Up @@ -466,7 +469,7 @@
},
"BRIDGE_FORM": {
"header": {
"title": "Move coins"
"title": "Move tokens"
},
"fees": {
"title": "Gas Fee",
Expand All @@ -487,7 +490,7 @@
"validation": {
"noAmountInputted": "Please input amount",
"insufficientBalance": "Insufficient balance",
"noTokenSelected": "Select a coin to move"
"noTokenSelected": "Select a token to move"
}
},
"BRIDGE_REVIEW": {
Expand Down Expand Up @@ -540,7 +543,7 @@
"withdrawalPending": {
"actionButtonText": "Proceed",
"withdrawalDelayText": "This move has been paused, please return ",
"withdrawalReadyText": "Action required to receive your coins",
"withdrawalReadyText": "Action required to receive your tokens",
"caption": "Paused"
},
"inProgress": {
Expand Down Expand Up @@ -582,7 +585,7 @@
},
"CLAIM_WITHDRAWAL": {
"content": {
"heading": "Follow the prompts to receive your coins on ",
"heading": "Follow the prompts to receive your tokens on ",
"body": "You’ll be asked to pay a small gas fee to claim your withdrawal.",
"body2": "Destination wallet address: "
},
Expand Down Expand Up @@ -669,7 +672,7 @@
"option": {
"fiatPricePrefix": "≈ USD $"
},
"noCoins": "You have no available coins to select in your wallet."
"noCoins": "You have no available tokens to select in your wallet."
},
"notEnoughGas": {
"content": {
Expand All @@ -678,25 +681,25 @@
},
"buttons": {
"adjustAmount": "Adjust amount",
"addMoreImx": "Add IMX coins",
"addMoreImx": "Add IMX tokens",
"copyAddress": "Copy wallet address",
"cancel": "Dismiss"
}
},
"notEnoughImx": {
"content": {
"noImx": {
"heading": "You'll need IMX coins to swap",
"body": "Swap fees are paid in IMX coins, so you'll need to add this before you can swap"
"heading": "You'll need IMX tokens to swap",
"body": "Swap fees are paid in IMX tokens, so you'll need to add this before you can swap"
},
"insufficientImx": {
"heading": "You'll need more IMX coins",
"body": "In order to cover the fees for the amount specified, you'll need to add more IMX coins"
"heading": "You'll need more IMX tokens",
"body": "In order to cover the fees for the amount specified, you'll need to add more IMX tokens"
}
},
"buttons": {
"adjustAmount": "Adjust amount",
"addMoreImx": "Add IMX coins",
"addMoreImx": "Add IMX tokens",
"cancel": "Dismiss"
}
},
Expand All @@ -713,8 +716,8 @@
}
},
"unableToSwap": {
"heading": "Unable to swap this coin",
"body": "This coin pairing isn't available to swap right now. Try another selection.",
"heading": "Unable to swap this token",
"body": "This token pairing isn't available to swap right now. Try another selection.",
"buttons": {
"cancel": "Dismiss"
}
Expand Down
Loading

0 comments on commit 64da48f

Please sign in to comment.