Skip to content

Commit

Permalink
Fix onramp disclaimer padding
Browse files Browse the repository at this point in the history
  • Loading branch information
mvaivre committed Feb 3, 2025
1 parent d1a2b82 commit eef31c6
Showing 1 changed file with 17 additions and 31 deletions.
48 changes: 17 additions & 31 deletions apps/mobile-wallet/src/features/buy/BuyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useURL } from 'expo-linking'
import { dismissBrowser, openBrowserAsync } from 'expo-web-browser'
import { useEffect } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import styled, { useTheme } from 'styled-components/native'
import { useTheme } from 'styled-components/native'

import AppText from '~/components/AppText'
import BottomButtons from '~/components/buttons/BottomButtons'
Expand All @@ -16,7 +15,6 @@ import { closeModal } from '~/features/modals/modalActions'
import withModal from '~/features/modals/withModal'
import { useAppDispatch, useAppSelector } from '~/hooks/redux'
import { selectAddressByHash } from '~/store/addresses/addressesSelectors'
import { DEFAULT_MARGIN } from '~/style/globalStyle'

export interface BuyModalProps {
receiveAddressHash: AddressHash
Expand All @@ -27,7 +25,6 @@ const CLOSE_BANXA_TAB_DEEP_LINK = 'alephium://close-banxa-tab'
const BuyModal = withModal<BuyModalProps>(({ id, receiveAddressHash }) => {
const { t } = useTranslation()
const theme = useTheme()
const insets = useSafeAreaInsets()
const dispatch = useAppDispatch()
const receiveAddress = useAppSelector((s) => selectAddressByHash(s, receiveAddressHash))
const banxaUrl = useBanxaUrl(receiveAddressHash)
Expand All @@ -53,36 +50,25 @@ const BuyModal = withModal<BuyModalProps>(({ id, receiveAddressHash }) => {

return (
<BottomModal modalId={id} title={t('Disclaimer')}>
<DisclaimerContent>
<AppText>
<Trans
t={t}
i18nKey="banxaDisclaimer"
components={{
1: <LinkToWeb url="https://www.banxa.com" />
}}
>
{
'You are about to access 3rd party services provided by <1>Banxa.com</1> through an in-app browser. Alephium does not control Banxa’s services. Banxa’s terms and conditions will apply, so please read and understand them before proceeding.'
}
</Trans>
</AppText>
<AppText>
<Trans
t={t}
i18nKey="banxaDisclaimer"
components={{
1: <LinkToWeb url="https://www.banxa.com" />
}}
>
{
'You are about to access 3rd party services provided by <1>Banxa.com</1> through an in-app browser. Alephium does not control Banxa’s services. Banxa’s terms and conditions will apply, so please read and understand them before proceeding.'
}
</Trans>
</AppText>

<BottomButtons fullWidth>
<Button
title={t('I understand')}
onPress={openBanxaUrl}
variant="highlight"
style={{ marginBottom: insets.bottom }}
/>
</BottomButtons>
</DisclaimerContent>
<BottomButtons fullWidth backgroundColor="back1">
<Button title={t('I understand')} onPress={openBanxaUrl} variant="highlight" />
</BottomButtons>
</BottomModal>
)
})

export default BuyModal

const DisclaimerContent = styled.View`
padding: ${DEFAULT_MARGIN}px;
`

0 comments on commit eef31c6

Please sign in to comment.