Skip to content

Commit a03613f

Browse files
committed
fix: resolve locale message merge conflicts
2 parents 2bd45f4 + 0cd3d47 commit a03613f

8 files changed

Lines changed: 49 additions & 15 deletions

File tree

src/components/AddressBlocked.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ export const AddressBlocked = ({ children }: { children: ReactNode }) => {
1111
const { currentAccount, readOnlyMode } = useWeb3Context();
1212
const { disconnect } = useDisconnect();
1313
const screenAddress = readOnlyMode || ENABLE_TESTNET ? '' : currentAccount;
14-
const { isAllowed } = useAddressAllowed(screenAddress);
14+
const { isAllowed, message } = useAddressAllowed(screenAddress);
1515

1616
if (!isAllowed) {
1717
return (
1818
<MainLayout>
19-
<AddressBlockedModal address={currentAccount} onDisconnectWallet={() => disconnect()} />;
19+
<AddressBlockedModal
20+
address={currentAccount}
21+
onDisconnectWallet={() => disconnect()}
22+
message={message}
23+
/>
24+
;
2025
</MainLayout>
2126
);
2227
}

src/components/AddressBlockedModal.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import { ExclamationCircleIcon, LogoutIcon } from '@heroicons/react/outline';
22
import { Trans } from '@lingui/macro';
3-
import { Box, Button, SvgIcon, Typography } from '@mui/material';
3+
import { Box, Button, Link, SvgIcon, Typography } from '@mui/material';
44

55
import { BasicModal } from './primitives/BasicModal';
66

77
export interface AddressBlockedProps {
88
address: string;
99
onDisconnectWallet: () => void;
10+
message?: string;
1011
}
1112

12-
export const AddressBlockedModal = ({ address, onDisconnectWallet }: AddressBlockedProps) => {
13+
export const AddressBlockedModal = ({
14+
address,
15+
onDisconnectWallet,
16+
message,
17+
}: AddressBlockedProps) => {
1318
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
1419
const setOpen = (_value: boolean) => {}; // ignore, we want the modal to not be dismissable
1520

@@ -27,13 +32,25 @@ export const AddressBlockedModal = ({ address, onDisconnectWallet }: AddressBloc
2732
<ExclamationCircleIcon />
2833
</SvgIcon>
2934
<Typography variant="h2">
30-
<Trans>Blocked Address</Trans>
35+
{message ? <Trans>Connection Failed</Trans> : <Trans>Blocked Address</Trans>}
3136
</Typography>
3237
<Typography variant="helperText" sx={{ my: 4 }}>
3338
{address}
3439
</Typography>
3540
<Typography variant="description" sx={{ textAlign: 'center', mb: 4 }}>
36-
<Trans>This address is blocked on app.aave.com.</Trans>
41+
{message ? (
42+
message
43+
) : (
44+
<>
45+
<Trans>
46+
This address is blocked on app.aave.com because it is associated with one or more
47+
</Trans>{' '}
48+
<Link href="https://docs.aave.com/faq/#address-screening" underline="always">
49+
<Trans>blocked activities</Trans>
50+
</Link>
51+
{'.'}
52+
</>
53+
)}
3754
</Typography>
3855
<Button variant="contained" onClick={onDisconnectWallet}>
3956
<SvgIcon fontSize="small" sx={{ mx: 1 }}>

src/hooks/useAddressAllowed.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { usePolling } from './usePolling';
44

55
export interface AddressAllowedResult {
66
isAllowed: boolean;
7+
message?: string;
78
}
89

910
const TWO_MINUTES = 2 * 60 * 1000;
1011

1112
export const useAddressAllowed = (address: string): AddressAllowedResult => {
1213
const [isAllowed, setIsAllowed] = useState(true);
14+
const [message, setMessage] = useState<string | undefined>(undefined);
1315

1416
const screeningUrl = `${process.env.NEXT_PUBLIC_API_BASEURL}/addresses/status`;
1517
const queryParams = `?address=${address}`;
@@ -19,8 +21,9 @@ export const useAddressAllowed = (address: string): AddressAllowedResult => {
1921
try {
2022
const response = await fetch(screeningUrl + queryParams);
2123
if (response.ok) {
22-
const data: { addressAllowed: boolean } = await response.json();
24+
const data: { addressAllowed: boolean; message?: string } = await response.json();
2325
setIsAllowed(data.addressAllowed);
26+
setMessage(data.message);
2427
}
2528
} catch (e) {}
2629
} else {
@@ -32,5 +35,6 @@ export const useAddressAllowed = (address: string): AddressAllowedResult => {
3235

3336
return {
3437
isAllowed,
38+
message,
3539
};
3640
};

src/locales/el/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,10 @@ msgstr "Borrow balance after switch"
18691869
msgid "Asset has been successfully sent to CCIP contract. You can check the status of the transactions below"
18701870
msgstr "Asset has been successfully sent to CCIP contract. You can check the status of the transactions below"
18711871

1872+
#: src/components/AddressBlockedModal.tsx
1873+
msgid "blocked activities"
1874+
msgstr "blocked activities"
1875+
18721876
#: pages/500.page.tsx
18731877
msgid "Reload the page"
18741878
msgstr "Reload the page"
@@ -2415,10 +2419,6 @@ msgstr "Action requires an active reserve"
24152419
msgid "Amount to unstake"
24162420
msgstr "Amount to unstake"
24172421

2418-
#: src/components/AddressBlockedModal.tsx
2419-
msgid "This address is blocked on app.aave.com."
2420-
msgstr "This address is blocked on app.aave.com."
2421-
24222422
#: src/components/infoTooltips/SlippageTooltip.tsx
24232423
msgid "Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification."
24242424
msgstr "Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification."
@@ -2558,6 +2558,10 @@ msgstr "Please connect your wallet to get free testnet assets."
25582558
msgid "Approve Confirmed"
25592559
msgstr "Approve Confirmed"
25602560

2561+
#: src/components/AddressBlockedModal.tsx
2562+
msgid "This address is blocked on app.aave.com because it is associated with one or more"
2563+
msgstr "This address is blocked on app.aave.com because it is associated with one or more"
2564+
25612565
#: src/ui-config/errorMapping.tsx
25622566
msgid "Zero address not valid"
25632567
msgstr "Zero address not valid"
@@ -3186,6 +3190,10 @@ msgstr "The caller of this function must be a pool"
31863190
msgid "Migrate to V3"
31873191
msgstr "Migrate to V3"
31883192

3193+
#: src/components/AddressBlockedModal.tsx
3194+
msgid "Connection Failed"
3195+
msgstr "Connection Failed"
3196+
31893197
#: src/modules/reserve-overview/ReserveConfiguration.tsx
31903198
msgid "Interest rate strategy"
31913199
msgstr "Interest rate strategy"

src/locales/es/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/fr/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)