Skip to content

Commit

Permalink
Add UK complaince to BuyCrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Oct 28, 2024
1 parent 6f90329 commit a93fe5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/scenes/TransactionListScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ function TransactionListComponent(props: Props) {
} else if (isSearching) {
return <SectionHeaderCentered title={lstrings.transaction_list_search_no_result} />
} else {
return <BuyCrypto navigation={navigation} wallet={wallet} tokenId={tokenId} />
return <BuyCrypto countryCode={route.params.countryCode} navigation={navigation} wallet={wallet} tokenId={tokenId} />
}
}, [isTransactionListUnsupported, navigation, isSearching, tokenId, wallet])
}, [isTransactionListUnsupported, isSearching, wallet, tokenId, route.params.countryCode, navigation])

const renderItem = useHandler(({ index, item }: ListRenderItemInfo<ListItem>) => {
if (item == null) {
Expand Down
6 changes: 4 additions & 2 deletions src/components/themed/BuyCrypto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useWatch } from '../../hooks/useWatch'
import { toPercentString } from '../../locales/intl'
import { lstrings } from '../../locales/strings'
import { NavigationBase } from '../../types/routerTypes'
import { getUkCompliantString } from '../../util/ukComplianceUtils'
import { CryptoIcon } from '../icons/CryptoIcon'
import { cacheStyles, Theme, useTheme } from '../services/ThemeContext'
import { EdgeText } from './EdgeText'
Expand All @@ -20,12 +21,13 @@ interface OwnProps {
wallet: EdgeCurrencyWallet
tokenId: EdgeTokenId
navigation: NavigationBase
countryCode?: string
}

type Props = OwnProps

export const BuyCrypto = (props: Props) => {
const { wallet, tokenId, navigation } = props
const { countryCode, wallet, tokenId, navigation } = props
const theme = useTheme()
const styles = getStyles(theme)

Expand All @@ -45,7 +47,7 @@ export const BuyCrypto = (props: Props) => {
<View style={styles.buyCrypto}>
<CryptoIcon walletId={wallet.id} tokenId={tokenId} marginRem={[0.25, 0]} sizeRem={2.25} />

<EdgeText style={styles.buyCryptoText}>{sprintf(lstrings.transaction_list_buy_crypto_message, displayName)}</EdgeText>
<EdgeText style={styles.buyCryptoText}>{getUkCompliantString(countryCode, 'buy_1s', displayName)}</EdgeText>
</View>
</View>
</ButtonBox>
Expand Down

0 comments on commit a93fe5c

Please sign in to comment.