Skip to content

Commit 0e75b2f

Browse files
committed
Merge branch 'frontend-3rd-party-guide-link'
2 parents 934f2f8 + ce670c6 commit 0e75b2f

File tree

4 files changed

+64
-9
lines changed

4 files changed

+64
-9
lines changed

frontends/web/src/components/guide/entry.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type TEntryProp = {
2323
title: string;
2424
text: string;
2525
link?: {
26-
url: string;
26+
url?: string;
2727
text: string;
2828
};
2929
}
@@ -58,12 +58,18 @@ export const Entry = (props: TProps) => {
5858
{entry.text.trim().split('\n').map((p, idx) => <p key={idx}>{p}</p>)}
5959
{entry.link && (
6060
<p>
61-
<A
62-
className={style.link}
63-
data-testid="link"
64-
href={entry.link.url}>
65-
{entry.link.text}
66-
</A>
61+
{entry.link.url ? (
62+
<A
63+
className={style.link}
64+
data-testid="link"
65+
href={entry.link.url}>
66+
{entry.link.text}
67+
</A>
68+
) : (
69+
<span className={style.link}>
70+
{entry.link.text}
71+
</span>
72+
)}
6773
</p>
6874
)}
6975
{props.children}

frontends/web/src/locales/en/app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,9 @@
958958
},
959959
"appendix": {
960960
"link": "Contact us!",
961-
"text": "Another question?"
961+
"questionService": "Having issues with {{serviceName}}?",
962+
"text": "Another question?",
963+
"textService": "If you are having issues with {{serviceName}}, please contact them directly:"
962964
},
963965
"backups": {
964966
"check": {

frontends/web/src/routes/bitsurance/guide.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const BitsuranceGuide = () => {
4747
<Entry key="guide.bitsurance.what" entry={t('guide.bitsurance.what', { returnObjects: true })} />
4848
<Entry key="guide.bitsurance.status" entry={t('guide.bitsurance.status', { returnObjects: true })} />
4949
<Entry key="guide.bitsurance.renew" entry={t('guide.bitsurance.renew', { returnObjects: true })} />
50+
5051
<Entry key="guide.bitsurance.privacy" entry={{
5152
link: {
5253
text: t('guide.bitsurance.privacy.link.text'),
@@ -63,6 +64,16 @@ export const BitsuranceGuide = () => {
6364
text: t('guide.bitsurance.faq.text'),
6465
title: t('guide.bitsurance.faq.title'),
6566
}} />
67+
<Entry
68+
key="guide.appendix.questionService"
69+
entry={{
70+
title: t('guide.appendix.questionService', { serviceName: 'Bitsurance' }),
71+
text: t('guide.appendix.textService', { serviceName: 'Bitsurance' }),
72+
link: {
73+
text: 'service@bitsurance.eu',
74+
},
75+
}}
76+
/>
6677
</Guide>
6778
);
6879
};

frontends/web/src/routes/exchange/guide.tsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,53 @@ const usePrivacyLink = (exchange?: TExchangeName) => {
4646
}
4747
};
4848

49+
const useServiceLink = (exchange?: TExchangeName) => {
50+
switch (exchange) {
51+
case 'btcdirect':
52+
return ({
53+
name: 'BTC Direct',
54+
text: 'btcdirect.eu/contact',
55+
url: 'https://btcdirect.eu/contact',
56+
});
57+
case 'moonpay':
58+
return ({
59+
name: 'MoonPay',
60+
text: 'support.moonpay.com',
61+
url: 'https://support.moonpay.com/',
62+
});
63+
case 'pocket':
64+
return ({
65+
name: 'Pocket Bitcoin',
66+
text: 'pocketbitcoin.com/contact',
67+
url: 'https://pocketbitcoin.com/contact',
68+
});
69+
}
70+
};
71+
4972
export const ExchangeGuide = ({ exchange, translationContext }: BuyGuideProps) => {
5073
const { t } = useTranslation();
5174
const link = usePrivacyLink(exchange);
75+
const serviceLink = useServiceLink(exchange);
5276

5377
return (
5478
<Guide title={t('guide.guideTitle.buySell')}>
5579
<Entry key="guide.buy.protection" entry={{
5680
link,
5781
text: t('buy.info.disclaimer.protection.descriptionGeneric', { context: translationContext }),
5882
title: t('buy.info.disclaimer.protection.title'),
59-
}} />
83+
}}
84+
/>
85+
<Entry
86+
key="guide.appendix.questionService"
87+
entry={{
88+
title: t('guide.appendix.questionService', { serviceName: serviceLink?.name }),
89+
text: t('guide.appendix.textService', { serviceName: serviceLink?.name }),
90+
link: {
91+
text: serviceLink?.text || '',
92+
url: serviceLink?.url,
93+
},
94+
}}
95+
/>
6096
</Guide>
6197
);
6298
};

0 commit comments

Comments
 (0)