Skip to content

Commit def4968

Browse files
authored
Merge pull request #4521 from brave-intl/feat/disconnect-confirmation
2 parents 7e1b27e + 3976d03 commit def4968

File tree

8 files changed

+92
-25
lines changed

8 files changed

+92
-25
lines changed

config/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ en:
113113
verification_failure_what_happened: What happened
114114
verification_failure: Your channel could not be verified!
115115
verification_failure_explanation:
116-
domain_not_found: "we could not find your domain."
116+
domain_not_found: "We could not find your domain."
117117
connection_failed: |
118118
we could not find the public file at https://%{domain}/.well-known/brave-rewards-verification.txt.
119119
too_many_redirects: "we were redirected too many times to verify your domain. "

nextjs/src/app/[locale]/publishers/home/channels/ChannelCard.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ export default function ChannelCard({ channel, publisherId, onChannelDelete }) {
132132
>
133133
{t('shared.remove')}
134134
</Button>
135-
<Button
136-
href={`/publishers/contribution_page?channel=${channel.id}`}
137-
kind='outline'
138-
>
139-
{t('shared.customize')}
140-
</Button>
135+
{!isUnverifiedChannel() && (
136+
<Button
137+
href={`/publishers/contribution_page?channel=${channel.id}`}
138+
kind='outline'
139+
>
140+
{t('shared.customize')}
141+
</Button>
142+
)}
141143
</section>
142144
</Card>
143145
);

nextjs/src/app/[locale]/publishers/home/channels/CryptoPrivacyModal.jsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ export default function CryptoPrivacyModal({ close, updateAddress, address }) {
1111
<div>
1212
<h1 className={styles['privacy-header']}>{t('Home.addCryptoWidget.privacyHeader')}</h1>
1313
<p className={styles['privacy-text']}>{t('Home.addCryptoWidget.privacyNotification')}</p>
14-
<div className={styles['privacy-button-container']}>
15-
<Button
16-
onClick={close}
17-
style={{ margin: '10px 0px', width: '320px' }}
18-
kind='outline'
19-
>
20-
{t('Home.addCryptoWidget.privacyQuit')}
21-
</Button>
22-
</div>
23-
<div className={styles['privacy-button-container']}>
24-
<Button
25-
onClick={() => {updateAddress(address); close()}}
26-
style={{ margin: '10px 0px', width: '320px' }}
27-
kind='plain'
28-
>
29-
{t('Home.addCryptoWidget.privacyContinue')}
30-
</Button>
14+
<div className="text-right">
15+
<div className={styles['privacy-button-container']}>
16+
<Button
17+
onClick={close}
18+
style={{ margin: '10px 0px', width: '320px' }}
19+
kind='outline'
20+
>
21+
{t('Home.addCryptoWidget.privacyQuit')}
22+
</Button>
23+
</div>
24+
<div className={styles['privacy-button-container']}>
25+
<Button
26+
onClick={() => {updateAddress(address); close()}}
27+
style={{ margin: '10px 0px', width: '320px' }}
28+
kind='filled'
29+
>
30+
{t('Home.addCryptoWidget.privacyContinue')}
31+
</Button>
32+
</div>
3133
</div>
3234
</div>
3335
)

nextjs/src/app/[locale]/publishers/home/custodianServices/CustodianServiceWidget.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Button from '@brave/leo/react/button';
44
import Dropdown from '@brave/leo/react/dropdown';
55
import Icon from '@brave/leo/react/icon';
66
import Link from '@brave/leo/react/link';
7+
import Dialog from '@brave/leo/react/dialog';
78
import Image from 'next/image';
89
import { useLocale, useTranslations } from 'next-intl';
910
import { useEffect, useState } from 'react';
@@ -12,6 +13,7 @@ import { apiRequest } from '@/lib/api';
1213

1314
import countryList from './countryList.json';
1415
import styles from '@/styles/Dashboard.module.css';
16+
import DisconnectConfirmationModal from './DisconnectConfirmationModal';
1517

1618
export default function CustodianServiceWidget({ walletData }) {
1719
const t = useTranslations();
@@ -23,6 +25,7 @@ export default function CustodianServiceWidget({ walletData }) {
2325
const [geminiConnection, setGeminiConnection] = useState(walletData.gemini_connection);
2426
const [bitflyerConnection, setBitflyerConnection] = useState(walletData.bitflyer_connection);
2527
const [unsupportedCountryMsg, setUnsupportedCountryMsg] = useState('');
28+
const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false);
2629

2730
const supportUrl = locale !== 'ja' ? 'https://support.brave.com/hc/en-us/articles/9884338155149' : 'https://support.brave.com/hc/en-us/articles/23311539795597';
2831

@@ -116,7 +119,7 @@ export default function CustodianServiceWidget({ walletData }) {
116119
<Link
117120
className={`pl-1 ${styles['disconnect-btn']}`}
118121
onClick={() => {
119-
disconnectProvider(provider);
122+
setIsConfirmationModalOpen(true);
120123
}}
121124
>
122125
Disconnect
@@ -132,6 +135,13 @@ export default function CustodianServiceWidget({ walletData }) {
132135
</span>
133136
<span>{t('shared.basic_attention_token')}</span>
134137
</div>
138+
<Dialog
139+
isOpen={isConfirmationModalOpen}
140+
onClose={() => setIsConfirmationModalOpen(false)}
141+
showClose={true}
142+
>
143+
<DisconnectConfirmationModal close={disconnectProvider} provider={provider} />
144+
</Dialog>
135145
</section>
136146
);
137147
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use client';
2+
3+
import Button from '@brave/leo/react/button';
4+
import { useTranslations } from 'next-intl';
5+
import styles from '@/styles/ChannelCard.module.css';
6+
7+
export default function DisconnectConfirmationModal({ close, provider }) {
8+
const t = useTranslations();
9+
10+
return (
11+
<div>
12+
<h1 className={styles['privacy-header']}>{t('walletServices.disconnectModal.title')}</h1>
13+
<p className={styles['privacy-text']}>{t('walletServices.disconnectModal.text', { provider: provider })}</p>
14+
<p className={styles['privacy-text']}>{t('walletServices.disconnectModal.textLine2')}</p>
15+
<div className="text-right">
16+
<div className={styles['privacy-button-container']}>
17+
<Button
18+
onClick={close}
19+
style={{ margin: '10px 0px', width: '320px' }}
20+
kind='outline'
21+
>
22+
{t('shared.cancel')}
23+
</Button>
24+
</div>
25+
<div className={styles['privacy-button-container']}>
26+
<Button
27+
onClick={() => {close(provider)}}
28+
style={{ margin: '10px 0px', width: '320px' }}
29+
kind='filled'
30+
>
31+
{t('walletServices.disconnectModal.confirmDisconnect')}
32+
</Button>
33+
</div>
34+
</div>
35+
</div>
36+
)
37+
}

nextjs/src/messages/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@
361361
"title": "Gemini Account",
362362
"duplicateAccount": "It looks like your Gemini account is already connected to another Brave Creators account. Please disconnect your Gemini account from any other Brave Creators accounts, and then try again."
363363
},
364+
"disconnectModal": {
365+
"title": "Confirm Disconnection",
366+
"text": "Are you sure you would like to disconnect your {provider} account from your Brave Creators account? Your sites and channels will no longer be able to receive contributions through {provider}.",
367+
"textLine2": "You will be able to connect an account again after disconnecting.",
368+
"confirmDisconnect": "Confirm disconnect"
369+
},
364370
"lastDeposit": "Last Deposit: <span>{value}</span>",
365371
"lastDepositDate": "Last Deposit Date: <span>{value}</span>",
366372
"title": "Account Services",

nextjs/src/messages/ja.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@
372372
"uphold": {
373373
"depositCurrency": "支払い通貨:BAT"
374374
},
375+
"disconnectModal": {
376+
"title": "切断確認",
377+
"text": "Brave Creatorsアカウントから {provider} アカウントを切断して本当によろしいですか? {provider} を通じてサイトやチャンネルでのコントリビューションが受け取れなくなります。",
378+
"textLine2": "切断後に改めてアカウントを接続することは可能です。",
379+
"confirmDisconnect": "切断する"
380+
},
375381
"addCryptoWidget": {
376382
"addWallet": "新しいウォレットを追加してください",
377383
"solanaConnectError": "アドレスを追加するためSolanaウォレットを接続してください",

nextjs/src/styles/ChannelCard.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@
8585
font-weight: 400;
8686
line-height: 26px;
8787
letter-spacing: -0.2px;
88+
padding-top: 20px;
8889
}
8990

9091
.privacy-button-container {
9192
text-align: center;
93+
display: inline-block;
94+
padding-top: 40px;
95+
padding-left: 10px;
9296
}
9397

9498
.add-channel-card {

0 commit comments

Comments
 (0)