Skip to content

Commit 22720d9

Browse files
committed
feat: Add Spend Crypto button to Home scene
Adds a new full-width button between Education Articles and Markets sections that launches the Bitrefill EdgeProvider webview for purchasing gift cards.
1 parent 70342bf commit 22720d9

File tree

9 files changed

+54
-1
lines changed

9 files changed

+54
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased (develop)
44

5+
- added: Spend Crypto button on Home scene to launch Bitrefill for gift card purchases
6+
57
## 4.34.0 (staging)
68

79
- added: `parseMarkdown` supports bold text (`**strong**`)
@@ -13,7 +15,7 @@
1315
- changed: Replaced 'react-native-camera' with 'react-native-vision-camera'
1416
- changed: Upgrade to React Native v0.79
1517
- changed: Update translations
16-
- changed: Enable `keysOnlyMode` for Bitcoin Gold
18+
- changed: Enable `keysOnlyMode` for Bitcoin Gold
1719
- changed: Increase tappable area of locked Settings
1820
- changed: Help Modal reordered and reworded; added Live Chat option that opens the default browser
1921
- fixed: App update modal could show multiple times whenever network reconnects

src/components/scenes/HomeScene.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Animated from 'react-native-reanimated'
66
import { useSafeAreaFrame } from 'react-native-safe-area-context'
77

88
import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
9+
import { guiPlugins } from '../../constants/plugins/GuiPlugins'
910
import { ENV } from '../../env'
1011
import { useHandler } from '../../hooks/useHandler'
1112
import { lstrings } from '../../locales/strings'
@@ -111,6 +112,9 @@ export const HomeScene = (props: Props) => {
111112
const handleSwapPress = useHandler(() => {
112113
navigation.navigate('swapTab')
113114
})
115+
const handleSpendPress = useHandler(() => {
116+
navigation.navigate('pluginView', { plugin: guiPlugins.bitrefill })
117+
})
114118
const handleViewAssetsPress = useHandler(() => {
115119
navigation.navigate('edgeTabs', {
116120
screen: 'walletsTab',
@@ -156,6 +160,10 @@ export const HomeScene = (props: Props) => {
156160
() => ({ uri: getUi4ImageUri(theme, 'cardBackgrounds/bg-trade1') }),
157161
[theme]
158162
)
163+
const spendCryptoIcon = React.useMemo(
164+
() => ({ uri: getUi4ImageUri(theme, 'cardBackgrounds/bg-spend-crypto1') }),
165+
[theme]
166+
)
159167
const homeRowStyle = React.useMemo(
160168
() => [styles.homeRowContainer, { height: cardSize }],
161169
[styles, cardSize]
@@ -270,6 +278,23 @@ export const HomeScene = (props: Props) => {
270278
<ContentPostCarousel contentPosts={blogPosts} />
271279
</>
272280
)}
281+
<EdgeAnim enter={fadeInUp30}>
282+
<HomeTileCard
283+
title={lstrings.spend_crypto}
284+
footer={lstrings.spend_crypto_footer}
285+
gradientBackground={theme.spendCardGradient}
286+
nodeBackground={
287+
<View style={styles.backroundImageContainer}>
288+
<FastImage
289+
source={spendCryptoIcon}
290+
style={styles.backgroundImage}
291+
resizeMode="stretch"
292+
/>
293+
</View>
294+
}
295+
onPress={handleSpendPress}
296+
/>
297+
</EdgeAnim>
273298
<>
274299
<SectionHeader
275300
leftTitle={lstrings.title_markets}

src/locales/en_US.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,9 @@ const strings = {
19381938
sell_crypto_footer: 'Crypto to bank or cash',
19391939
swap_crypto: 'Swap Crypto',
19401940
swap_crypto_footer: 'Crypto to another crypto',
1941+
spend_crypto: 'Spend Crypto',
1942+
spend_crypto_footer:
1943+
'Spend crypto to buy gift cards for 100s of stores and restaurants',
19411944
fio_web3: 'Web3 Handle',
19421945
fio_web3_footer: 'Manage your handles and domains',
19431946
title_home: 'Home',

src/locales/strings/enUS.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,8 @@
14781478
"sell_crypto_footer": "Crypto to bank or cash",
14791479
"swap_crypto": "Swap Crypto",
14801480
"swap_crypto_footer": "Crypto to another crypto",
1481+
"spend_crypto": "Spend Crypto",
1482+
"spend_crypto_footer": "Spend crypto to buy gift cards for 100s of stores and restaurants",
14811483
"fio_web3": "Web3 Handle",
14821484
"fio_web3_footer": "Manage your handles and domains",
14831485
"title_home": "Home",

src/theme/variables/edgeDark.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,11 @@ export const edgeDark: Theme = {
563563
end: { x: 0, y: 1 },
564564
start: { x: 1, y: 0 }
565565
},
566+
spendCardGradient: {
567+
colors: [palette.purpleOp50, palette.transparent],
568+
end: { x: 0, y: 1 },
569+
start: { x: 1, y: 0 }
570+
},
566571

567572
txDirBgReceive: palette.greenOp60,
568573
txDirBgSend: palette.redOp60,

src/theme/variables/edgeLight.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ export const edgeLight: Theme = {
514514
end: { x: 0, y: 1 },
515515
start: { x: 1, y: 0 }
516516
},
517+
spendCardGradient: {
518+
colors: [palette.purpleOp24, palette.transparent],
519+
end: { x: 0, y: 1 },
520+
start: { x: 1, y: 0 }
521+
},
517522
txDirBgReceive: palette.greenOp60,
518523
txDirBgSend: palette.redOp60,
519524
txDirBgSwap: palette.grayOp70,

src/theme/variables/testDark.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,11 @@ export const testDark: Theme = {
556556
end: { x: 0, y: 1 },
557557
start: { x: 1, y: 0 }
558558
},
559+
spendCardGradient: {
560+
colors: [palette.purpleOp50, palette.transparent],
561+
end: { x: 0, y: 1 },
562+
start: { x: 1, y: 0 }
563+
},
559564

560565
txDirBgReceive: palette.greenOp60,
561566
txDirBgSend: palette.redOp60,

src/theme/variables/testLight.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ export const testLight: Theme = {
514514
end: { x: 0, y: 1 },
515515
start: { x: 1, y: 0 }
516516
},
517+
spendCardGradient: {
518+
colors: [palette.purpleOp24, palette.transparent],
519+
end: { x: 0, y: 1 },
520+
start: { x: 1, y: 0 }
521+
},
517522

518523
txDirBgReceive: palette.greenOp60,
519524
txDirBgSend: palette.redOp60,

src/types/Theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ export interface Theme {
461461
sellCardGradient: ThemeGradientParams
462462
earnCardGradient: ThemeGradientParams
463463
swapCardGradient: ThemeGradientParams
464+
spendCardGradient: ThemeGradientParams
464465

465466
txDirBgReceive: string
466467
txDirBgSend: string

0 commit comments

Comments
 (0)