Skip to content

Commit 96b0de2

Browse files
committed
fixup! Integrate ramp plugin with UI
- Remove useMemo from TradeCreateScene country lookup - Add 'Buying into wallet' display in TradeOptionSelectScene - Fix localization strings: - Add buy_cryptocurrency_scene_title - Remove trade_region_select_buy_crypto (use buy_crypto instead) - Remove colon from trade_option_powered_by_label - Add buying_into_wallet_1s string
1 parent 8f479aa commit 96b0de2

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

src/components/scenes/TradeCreateScene.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ export const TradeCreateScene = (props: Props): React.ReactElement => {
119119
state => state.ui.settings
120120
)
121121

122-
const countryData = React.useMemo(
123-
() => COUNTRY_CODES.find(c => c['alpha-2'] === countryCode),
124-
[countryCode]
125-
)
122+
const countryData = COUNTRY_CODES.find(c => c['alpha-2'] === countryCode)
126123

127124
// Determine whether to show the region selection scene variant
128125
const shouldShowRegionSelect =
@@ -406,7 +403,7 @@ export const TradeCreateScene = (props: Props): React.ReactElement => {
406403
if (shouldShowRegionSelect) {
407404
return (
408405
<SceneWrapper scroll hasTabs>
409-
<SceneContainer headerTitle={lstrings.trade_region_select_buy_crypto}>
406+
<SceneContainer headerTitle={lstrings.buy_crypto}>
410407
<SubtitleText>
411408
{lstrings.trade_region_select_start_steps}
412409
</SubtitleText>

src/components/scenes/TradeOptionSelectScene.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ export const TradeOptionSelectScene = (props: Props): React.JSX.Element => {
136136
return (
137137
<SceneWrapper scroll hasTabs>
138138
<SceneContainer headerTitle={lstrings.trade_option_buy_title}>
139+
{rampQuoteRequest.wallet != null && (
140+
<WalletInfoText>
141+
{sprintf(
142+
lstrings.buying_into_wallet_1s,
143+
rampQuoteRequest.wallet.name
144+
)}
145+
</WalletInfoText>
146+
)}
139147
<SectionHeader
140148
leftTitle={lstrings.trade_option_select_payment_method}
141149
rightNode={
@@ -356,6 +364,15 @@ const ShimmerCard = styled(View)(theme => ({
356364
position: 'relative'
357365
}))
358366

367+
const WalletInfoText = styled(EdgeText)(theme => ({
368+
color: theme.secondaryText,
369+
fontSize: theme.rem(0.875),
370+
textAlign: 'center',
371+
marginTop: theme.rem(0.5),
372+
marginBottom: theme.rem(0.5),
373+
marginHorizontal: theme.rem(1)
374+
}))
375+
359376
// Utility mapping for payment types to custom title keys
360377
const paymentTypeToCustomTitleKey: Record<string, string> = {
361378
applepay: 'applepay'

src/locales/en_US.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,16 +1935,18 @@ const strings = {
19351935
sell_crypto_footer: 'Crypto to bank or cash',
19361936

19371937
// Trade Option Select Scene
1938+
buy_cryptocurrency_scene_title: 'Buy Cryptocurrency',
19381939
trade_option_buy_title: 'Buy Cryptocurrency',
19391940
trade_option_sell_title: 'Sell Cryptocurrency',
19401941
trade_option_select_payment_method: 'Select Payment Method',
1942+
buying_into_wallet_1s: 'Buying into wallet: %s',
19411943
trade_option_choose_provider: 'Choose Provider',
19421944
trade_option_no_quotes_title: 'No quotes available',
19431945
trade_option_no_quotes_body:
19441946
'Please try again later. No providers are currently available.',
19451947
trade_option_total_label: 'Total',
19461948
trade_option_settlement_label: 'Settlement',
1947-
trade_option_powered_by_label: 'Powered By:',
1949+
trade_option_powered_by_label: 'Powered By',
19481950
trade_option_best_rate_label: 'BEST\nRATE',
19491951
trade_option_provider_failed_s: '%s Failed',
19501952
swap_crypto: 'Swap Crypto',
@@ -1992,7 +1994,7 @@ const strings = {
19921994
enter_value: 'Enter Value',
19931995

19941996
// Trade Region Select Scene
1995-
trade_region_select_buy_crypto: 'Buy Crypto',
1997+
19961998
trade_region_select_start_steps: 'Start in 4 Easy Steps',
19971999
trade_region_select_step_1: 'Select Your Region for personalized options',
19982000
trade_region_select_step_2: 'Create Your Quote',

src/locales/strings/enUS.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,15 +1474,17 @@
14741474
"see_all": "See All",
14751475
"sell_crypto": "Sell Crypto",
14761476
"sell_crypto_footer": "Crypto to bank or cash",
1477+
"buy_cryptocurrency_scene_title": "Buy Cryptocurrency",
14771478
"trade_option_buy_title": "Buy Cryptocurrency",
14781479
"trade_option_sell_title": "Sell Cryptocurrency",
14791480
"trade_option_select_payment_method": "Select Payment Method",
1481+
"buying_into_wallet_1s": "Buying into wallet: %s",
14801482
"trade_option_choose_provider": "Choose Provider",
14811483
"trade_option_no_quotes_title": "No quotes available",
14821484
"trade_option_no_quotes_body": "Please try again later. No providers are currently available.",
14831485
"trade_option_total_label": "Total",
14841486
"trade_option_settlement_label": "Settlement",
1485-
"trade_option_powered_by_label": "Powered By:",
1487+
"trade_option_powered_by_label": "Powered By",
14861488
"trade_option_best_rate_label": "BEST\nRATE",
14871489
"trade_option_provider_failed_s": "%s Failed",
14881490
"swap_crypto": "Swap Crypto",
@@ -1516,7 +1518,6 @@
15161518
"edge_ucation": "Edge-ucation",
15171519
"education": "Education",
15181520
"enter_value": "Enter Value",
1519-
"trade_region_select_buy_crypto": "Buy Crypto",
15201521
"trade_region_select_start_steps": "Start in 4 Easy Steps",
15211522
"trade_region_select_step_1": "Select Your Region for personalized options",
15221523
"trade_region_select_step_2": "Create Your Quote",

0 commit comments

Comments
 (0)