Skip to content

Commit b49207a

Browse files
authored
Merge pull request #5717 from EdgeApp/sam/spend-crypto-btn
feat: Add Spend Crypto button to Home scene
2 parents c004114 + eb6da3a commit b49207a

File tree

10 files changed

+75
-5
lines changed

10 files changed

+75
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
## 4.35.0 (staging)
66

7+
- added: Spend Crypto button on Home scene to launch Bitrefill for gift card purchases
78
- changed: Use rates server v3 endpoint
89

910
## 4.34.0 (2025-09-09)

src/components/cards/HomeTileCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const HomeTileCard = (props: Props) => {
3636
fill
3737
>
3838
<View style={styles.verticalSplitContainer}>
39-
<EdgeText style={theme.cardTextShadow}>{title}</EdgeText>
39+
<EdgeText style={[theme.cardTextShadow, styles.titleText]}>
40+
{title}
41+
</EdgeText>
4042
<EdgeText
4143
style={styles.footerText}
4244
numberOfLines={3}
@@ -50,6 +52,9 @@ export const HomeTileCard = (props: Props) => {
5052
}
5153

5254
const getStyles = cacheStyles((theme: Theme) => ({
55+
titleText: {
56+
marginBottom: theme.rem(0.5)
57+
},
5358
footerText: {
5459
fontSize: theme.rem(0.75),
5560
...theme.cardTextShadow

src/components/scenes/HomeScene.tsx

Lines changed: 34 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.spendBackgroundImageContainer}>
288+
<FastImage
289+
source={spendCryptoIcon}
290+
style={styles.spendBackgroundImage}
291+
resizeMode="contain"
292+
/>
293+
</View>
294+
}
295+
onPress={handleSpendPress}
296+
/>
297+
</EdgeAnim>
273298
<>
274299
<SectionHeader
275300
leftTitle={lstrings.title_markets}
@@ -317,6 +342,15 @@ const getStyles = cacheStyles((theme: Theme) => ({
317342
aspectRatio: 1,
318343
width: '100%'
319344
},
345+
spendBackgroundImageContainer: {
346+
alignItems: 'flex-end',
347+
justifyContent: 'center',
348+
opacity: 0.5
349+
},
350+
spendBackgroundImage: {
351+
aspectRatio: 1,
352+
height: '100%'
353+
},
320354
homeRowContainer: {
321355
flexDirection: 'row',
322356
// flexGrow: 1,

src/locales/en_US.ts

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

src/locales/strings/enUS.json

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

src/theme/variables/edgeDark.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ const palette = {
114114
orangeOp50: 'rgba(192, 93, 12, 0.5)',
115115
lightBlueOp50: 'rgba(10, 129, 153, 0.5)',
116116
purpleOp50: 'rgba(65, 35, 184, 0.5)',
117-
pinkOp50: 'rgba(219, 57, 159, 0.5)'
117+
pinkOp50: 'rgba(219, 57, 159, 0.5)',
118+
goldOp50: 'rgba(214, 190, 48, 0.5)'
118119
}
119120

120121
const deviceWidth = Dimensions.get('window').width
@@ -563,6 +564,11 @@ export const edgeDark: Theme = {
563564
end: { x: 0, y: 1 },
564565
start: { x: 1, y: 0 }
565566
},
567+
spendCardGradient: {
568+
colors: [palette.goldOp50, palette.blackTransparent],
569+
end: { x: 0, y: 1 },
570+
start: { x: 1, y: 0 }
571+
},
566572

567573
txDirBgReceive: palette.greenOp60,
568574
txDirBgSend: palette.redOp60,

src/theme/variables/edgeLight.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ const palette = {
103103
orangeOp24: '#fc9e733d',
104104
lightBlueOp24: '#4ea5bc3d',
105105
purpleOp24: '#4123b73d',
106-
pinkOp24: '#db37a03d'
106+
pinkOp24: '#db37a03d',
107+
goldOp24: '#d6be303d'
107108
}
108109

109110
const deviceWidth = Dimensions.get('window').width
@@ -514,6 +515,11 @@ export const edgeLight: Theme = {
514515
end: { x: 0, y: 1 },
515516
start: { x: 1, y: 0 }
516517
},
518+
spendCardGradient: {
519+
colors: [palette.goldOp24, palette.transparent],
520+
end: { x: 0, y: 1 },
521+
start: { x: 1, y: 0 }
522+
},
517523
txDirBgReceive: palette.greenOp60,
518524
txDirBgSend: palette.redOp60,
519525
txDirBgSwap: palette.grayOp70,

src/theme/variables/testDark.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ const palette = {
110110
orangeOp50: 'rgba(192, 93, 12, 0.5)',
111111
lightBlueOp50: 'rgba(10, 129, 153, 0.5)',
112112
purpleOp50: 'rgba(65, 35, 184, 0.5)',
113-
pinkOp50: 'rgba(219, 57, 159, 0.5)'
113+
pinkOp50: 'rgba(219, 57, 159, 0.5)',
114+
goldOp50: 'rgba(214, 190, 48, 0.5)'
114115
}
115116

116117
const deviceWidth = Dimensions.get('window').width
@@ -556,6 +557,11 @@ export const testDark: Theme = {
556557
end: { x: 0, y: 1 },
557558
start: { x: 1, y: 0 }
558559
},
560+
spendCardGradient: {
561+
colors: [palette.goldOp50, palette.blackTransparent],
562+
end: { x: 0, y: 1 },
563+
start: { x: 1, y: 0 }
564+
},
559565

560566
txDirBgReceive: palette.greenOp60,
561567
txDirBgSend: palette.redOp60,

src/theme/variables/testLight.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ const palette = {
103103
orangeOp24: '#fc9e733d',
104104
lightBlueOp24: '#4ea5bc3d',
105105
purpleOp24: '#4123b73d',
106-
pinkOp24: '#db37a03d'
106+
pinkOp24: '#db37a03d',
107+
goldOp24: '#d6be303d'
107108
}
108109

109110
const deviceWidth = Dimensions.get('window').width
@@ -514,6 +515,11 @@ export const testLight: Theme = {
514515
end: { x: 0, y: 1 },
515516
start: { x: 1, y: 0 }
516517
},
518+
spendCardGradient: {
519+
colors: [palette.goldOp24, palette.transparent],
520+
end: { x: 0, y: 1 },
521+
start: { x: 1, y: 0 }
522+
},
517523

518524
txDirBgReceive: palette.greenOp60,
519525
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)