Skip to content

Commit

Permalink
frontend: update guide with btcdirect privacy link
Browse files Browse the repository at this point in the history
Added case for BTC Direct privacy protection link so that the
in-app guide shows the correct link.
  • Loading branch information
thisconnect committed Feb 13, 2025
1 parent 53578a5 commit e4eb57b
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions frontends/web/src/routes/exchange/guide.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022-2024 Shift Crypto AG
* Copyright 2022-2025 Shift Crypto AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,31 +18,42 @@ import { useTranslation } from 'react-i18next';
import type { TExchangeName } from '@/api/exchanges';
import { Entry } from '@/components/guide/entry';
import { Guide } from '@/components/guide/guide';
import { getBTCDirectPrivacyLink } from '@/components/terms/btcdirect-otc-terms';

interface BuyGuideProps {
type BuyGuideProps = {
exchange?: TExchangeName;
translationContext: 'bitcoin' | 'crypto';
}

export const ExchangeGuide = ({ exchange, translationContext }: BuyGuideProps) => {
const usePrivacyLink = (exchange?: TExchangeName) => {
const { t } = useTranslation();
switch (exchange) {
case 'btcdirect':
return ({
text: t('buy.exchange.infoContent.btcdirect.disclaimer.dataProtection.link'),
url: getBTCDirectPrivacyLink(),
});
case 'moonpay':
return ({
text: t('buy.info.disclaimer.privacyPolicy'),
url: 'https://www.moonpay.com/privacy_policy',
});
case 'pocket':
return ({
text: t('exchange.pocket.terms.dataprotection.link'),
url: 'https://pocketbitcoin.com/policy/privacy',
});
}
};

const pocketLink = {
text: t('exchange.pocket.terms.dataprotection.link'),
url: 'https://pocketbitcoin.com/policy/privacy',
};

const moonpayLink = {
text: t('buy.info.disclaimer.privacyPolicy'),
url: 'https://www.moonpay.com/privacy_policy',
};

const privacyLink = exchange === 'pocket' ? pocketLink : moonpayLink;
export const ExchangeGuide = ({ exchange, translationContext }: BuyGuideProps) => {
const { t } = useTranslation();
const link = usePrivacyLink(exchange);

return (
<Guide title={t('guide.guideTitle.buySell')}>
<Entry key="guide.buy.protection" entry={{
link: exchange ? privacyLink : undefined,
link,
text: t('buy.info.disclaimer.protection.descriptionGeneric', { context: translationContext }),
title: t('buy.info.disclaimer.protection.title'),
}} />
Expand Down

0 comments on commit e4eb57b

Please sign in to comment.