Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased (develop)

- added: Spend Crypto button on Home scene to launch Bitrefill for gift card purchases

## 4.34.0 (staging)

- added: `parseMarkdown` supports bold text (`**strong**`)
Expand Down
7 changes: 6 additions & 1 deletion src/components/cards/HomeTileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export const HomeTileCard = (props: Props) => {
fill
>
<View style={styles.verticalSplitContainer}>
<EdgeText style={theme.cardTextShadow}>{title}</EdgeText>
<EdgeText style={[theme.cardTextShadow, styles.titleText]}>
{title}
</EdgeText>
<EdgeText
style={styles.footerText}
numberOfLines={3}
Expand All @@ -50,6 +52,9 @@ export const HomeTileCard = (props: Props) => {
}

const getStyles = cacheStyles((theme: Theme) => ({
titleText: {
marginBottom: theme.rem(0.5)
},
footerText: {
fontSize: theme.rem(0.75),
...theme.cardTextShadow
Expand Down
34 changes: 34 additions & 0 deletions src/components/scenes/HomeScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Animated from 'react-native-reanimated'
import { useSafeAreaFrame } from 'react-native-safe-area-context'

import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
import { guiPlugins } from '../../constants/plugins/GuiPlugins'
import { ENV } from '../../env'
import { useHandler } from '../../hooks/useHandler'
import { lstrings } from '../../locales/strings'
Expand Down Expand Up @@ -111,6 +112,9 @@ export const HomeScene = (props: Props) => {
const handleSwapPress = useHandler(() => {
navigation.navigate('swapTab')
})
const handleSpendPress = useHandler(() => {
navigation.navigate('pluginView', { plugin: guiPlugins.bitrefill })
})
const handleViewAssetsPress = useHandler(() => {
navigation.navigate('edgeTabs', {
screen: 'walletsTab',
Expand Down Expand Up @@ -156,6 +160,10 @@ export const HomeScene = (props: Props) => {
() => ({ uri: getUi4ImageUri(theme, 'cardBackgrounds/bg-trade1') }),
[theme]
)
const spendCryptoIcon = React.useMemo(
() => ({ uri: getUi4ImageUri(theme, 'cardBackgrounds/bg-spend-crypto1') }),
[theme]
)
const homeRowStyle = React.useMemo(
() => [styles.homeRowContainer, { height: cardSize }],
[styles, cardSize]
Expand Down Expand Up @@ -270,6 +278,23 @@ export const HomeScene = (props: Props) => {
<ContentPostCarousel contentPosts={blogPosts} />
</>
)}
<EdgeAnim enter={fadeInUp30}>
<HomeTileCard
title={lstrings.spend_crypto}
footer={lstrings.spend_crypto_footer}
gradientBackground={theme.spendCardGradient}
nodeBackground={
<View style={styles.spendBackgroundImageContainer}>
<FastImage
source={spendCryptoIcon}
style={styles.spendBackgroundImage}
resizeMode="contain"
/>
</View>
}
onPress={handleSpendPress}
/>
</EdgeAnim>
<>
<SectionHeader
leftTitle={lstrings.title_markets}
Expand Down Expand Up @@ -317,6 +342,15 @@ const getStyles = cacheStyles((theme: Theme) => ({
aspectRatio: 1,
width: '100%'
},
spendBackgroundImageContainer: {
alignItems: 'flex-end',
justifyContent: 'center',
opacity: 0.5
},
spendBackgroundImage: {
aspectRatio: 1,
height: '100%'
},
homeRowContainer: {
flexDirection: 'row',
// flexGrow: 1,
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,9 @@ const strings = {
sell_crypto_footer: 'Crypto to bank or cash',
swap_crypto: 'Swap Crypto',
swap_crypto_footer: 'Crypto to another crypto',
spend_crypto: 'Spend Crypto',
spend_crypto_footer:
'Spend crypto to buy gift cards for 100s of stores and restaurants',
fio_web3: 'Web3 Handle',
fio_web3_footer: 'Manage your handles and domains',
title_home: 'Home',
Expand Down
2 changes: 2 additions & 0 deletions src/locales/strings/enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,8 @@
"sell_crypto_footer": "Crypto to bank or cash",
"swap_crypto": "Swap Crypto",
"swap_crypto_footer": "Crypto to another crypto",
"spend_crypto": "Spend Crypto",
"spend_crypto_footer": "Spend crypto to buy gift cards for 100s of stores and restaurants",
"fio_web3": "Web3 Handle",
"fio_web3_footer": "Manage your handles and domains",
"title_home": "Home",
Expand Down
8 changes: 7 additions & 1 deletion src/theme/variables/edgeDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const palette = {
orangeOp50: 'rgba(192, 93, 12, 0.5)',
lightBlueOp50: 'rgba(10, 129, 153, 0.5)',
purpleOp50: 'rgba(65, 35, 184, 0.5)',
pinkOp50: 'rgba(219, 57, 159, 0.5)'
pinkOp50: 'rgba(219, 57, 159, 0.5)',
goldOp50: 'rgba(214, 190, 48, 0.5)'
}

const deviceWidth = Dimensions.get('window').width
Expand Down Expand Up @@ -563,6 +564,11 @@ export const edgeDark: Theme = {
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},
spendCardGradient: {
colors: [palette.goldOp50, palette.blackTransparent],
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},

txDirBgReceive: palette.greenOp60,
txDirBgSend: palette.redOp60,
Expand Down
8 changes: 7 additions & 1 deletion src/theme/variables/edgeLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const palette = {
orangeOp24: '#fc9e733d',
lightBlueOp24: '#4ea5bc3d',
purpleOp24: '#4123b73d',
pinkOp24: '#db37a03d'
pinkOp24: '#db37a03d',
goldOp24: '#d6be303d'
}

const deviceWidth = Dimensions.get('window').width
Expand Down Expand Up @@ -514,6 +515,11 @@ export const edgeLight: Theme = {
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},
spendCardGradient: {
colors: [palette.goldOp24, palette.transparent],
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},
txDirBgReceive: palette.greenOp60,
txDirBgSend: palette.redOp60,
txDirBgSwap: palette.grayOp70,
Expand Down
8 changes: 7 additions & 1 deletion src/theme/variables/testDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const palette = {
orangeOp50: 'rgba(192, 93, 12, 0.5)',
lightBlueOp50: 'rgba(10, 129, 153, 0.5)',
purpleOp50: 'rgba(65, 35, 184, 0.5)',
pinkOp50: 'rgba(219, 57, 159, 0.5)'
pinkOp50: 'rgba(219, 57, 159, 0.5)',
goldOp50: 'rgba(214, 190, 48, 0.5)'
}

const deviceWidth = Dimensions.get('window').width
Expand Down Expand Up @@ -556,6 +557,11 @@ export const testDark: Theme = {
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},
spendCardGradient: {
colors: [palette.goldOp50, palette.blackTransparent],
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},

txDirBgReceive: palette.greenOp60,
txDirBgSend: palette.redOp60,
Expand Down
8 changes: 7 additions & 1 deletion src/theme/variables/testLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const palette = {
orangeOp24: '#fc9e733d',
lightBlueOp24: '#4ea5bc3d',
purpleOp24: '#4123b73d',
pinkOp24: '#db37a03d'
pinkOp24: '#db37a03d',
goldOp24: '#d6be303d'
}

const deviceWidth = Dimensions.get('window').width
Expand Down Expand Up @@ -514,6 +515,11 @@ export const testLight: Theme = {
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},
spendCardGradient: {
colors: [palette.goldOp24, palette.transparent],
end: { x: 0, y: 1 },
start: { x: 1, y: 0 }
},

txDirBgReceive: palette.greenOp60,
txDirBgSend: palette.redOp60,
Expand Down
1 change: 1 addition & 0 deletions src/types/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ export interface Theme {
sellCardGradient: ThemeGradientParams
earnCardGradient: ThemeGradientParams
swapCardGradient: ThemeGradientParams
spendCardGradient: ThemeGradientParams

txDirBgReceive: string
txDirBgSend: string
Expand Down
Loading