Skip to content

Commit

Permalink
fix: trans tag wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
defispartan committed Sep 16, 2022
1 parent 0d6b55b commit 60c4ae9
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 20 deletions.
13 changes: 6 additions & 7 deletions src/components/transactions/Warnings/MarketWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Trans } from '@lingui/macro';
import { Link, Typography, AlertColor } from '@mui/material';
import { ReactNode } from 'react';

import { Warning } from '../../primitives/Warning';

interface MarketWarningProps {
learnMore?: boolean; // Modify wording on link text,
warningMessage: string;
warningMessage: ReactNode;
linkHref?: string;
warningType: AlertColor;
}
Expand All @@ -19,12 +20,10 @@ export const MarketWarning = ({
return (
<Warning severity={warningType}>
<Typography variant="caption">
<Trans>
{warningMessage}{' '}
<Link href={linkHref} target="_blank">
{learnMore ? 'Learn More' : 'Join the community discussion'}
</Link>
</Trans>
{warningMessage}{' '}
<Link href={linkHref} target="_blank">
{learnMore ? <Trans>Learn More</Trans> : <Trans>Join the community discussion</Trans>}
</Link>
</Typography>
</Warning>
);
Expand Down
7 changes: 6 additions & 1 deletion src/locales/en/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@
Discord: 'Discord',
'Due to a precision bug in the stETH contract, this asset can not be used in flashloan transactions':
'Due to a precision bug in the stETH contract, this asset can not be used in flashloan transactions',
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.':
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.',
'E-Mode': 'E-Mode',
'E-Mode Category': 'E-Mode Category',
'E-Mode category': 'E-Mode category',
Expand Down Expand Up @@ -264,7 +266,9 @@
'Isolated Debt Ceiling': 'Isolated Debt Ceiling',
'Isolated assets have limited borrowing power and other assets cannot be used as collateral.':
'Isolated assets have limited borrowing power and other assets cannot be used as collateral.',
'Join the community discussion': 'Join the community discussion',
Language: 'Language',
'Learn More': 'Learn More',
'Learn more': 'Learn more',
'Learn more about risks involved': 'Learn more about risks involved',
'Learn more in our <0>FAQ guide</0>': 'Learn more in our <0>FAQ guide</0>',
Expand Down Expand Up @@ -343,6 +347,8 @@
' reserve gives annualized rewards.',
],
'Pending...': 'Pending...',
'Per the community, the Fantom market has been frozen.':
'Per the community, the Fantom market has been frozen.',
'Please connect a wallet to view your personal information here.':
'Please connect a wallet to view your personal information here.',
'Please connect your wallet to get free testnet assets.':
Expand Down Expand Up @@ -719,6 +725,5 @@
'{networkName} Faucet': [['networkName'], ' Faucet'],
'{s}s': [['s'], 's'],
'{tooltipText}': [['tooltipText']],
'{warningMessage} <0>{0}</0>': [['warningMessage'], ' <0>', ['0'], '</0>'],
},
};
26 changes: 22 additions & 4 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,13 @@ msgstr "Discord"
msgid "Due to a precision bug in the stETH contract, this asset can not be used in flashloan transactions"
msgstr "Due to a precision bug in the stETH contract, this asset can not be used in flashloan transactions"

#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsList.tsx
#: src/modules/dashboard/lists/SupplyAssetsList/SupplyAssetsList.tsx
#: src/modules/markets/AssetsList.tsx
#: src/modules/reserve-overview/ReserveActions.tsx
msgid "Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market."
msgstr "Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market."

#: src/modules/dashboard/DashboardEModeButton.tsx
msgid "E-Mode"
msgstr "E-Mode"
Expand Down Expand Up @@ -874,10 +881,18 @@ msgstr "Isolated Debt Ceiling"
msgid "Isolated assets have limited borrowing power and other assets cannot be used as collateral."
msgstr "Isolated assets have limited borrowing power and other assets cannot be used as collateral."

#: src/components/transactions/Warnings/MarketWarning.tsx
msgid "Join the community discussion"
msgstr "Join the community discussion"

#: src/layouts/components/LanguageSwitcher.tsx
msgid "Language"
msgstr "Language"

#: src/components/transactions/Warnings/MarketWarning.tsx
msgid "Learn More"
msgstr "Learn More"

#: src/components/caps/DebtCeilingStatus.tsx
#: src/components/infoTooltips/BorrowCapMaxedTooltip.tsx
#: src/components/infoTooltips/DebtCeilingMaxedTooltip.tsx
Expand Down Expand Up @@ -1122,6 +1137,13 @@ msgstr "Participating in this {symbol} reserve gives annualized rewards."
msgid "Pending..."
msgstr "Pending..."

#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsList.tsx
#: src/modules/dashboard/lists/SupplyAssetsList/SupplyAssetsList.tsx
#: src/modules/markets/AssetsList.tsx
#: src/modules/reserve-overview/ReserveActions.tsx
msgid "Per the community, the Fantom market has been frozen."
msgstr "Per the community, the Fantom market has been frozen."

#: src/modules/reserve-overview/ReserveActions.tsx
msgid "Please connect a wallet to view your personal information here."
msgstr "Please connect a wallet to view your personal information here."
Expand Down Expand Up @@ -2199,7 +2221,3 @@ msgstr "{s}s"
#: src/components/CircleIcon.tsx
msgid "{tooltipText}"
msgstr "{tooltipText}"

#: src/components/transactions/Warnings/MarketWarning.tsx
msgid "{warningMessage} <0>{0}</0>"
msgstr "{warningMessage} <0>{0}</0>"
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ export const BorrowAssetsList = () => {
learnMore={true}
linkHref={`https://governance.aave.com/t/harmony-horizon-bridge-exploit-consequences-to-aave-v3-harmony/8614`}
warningMessage={
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.'
<Trans>
Due to the Horizon bridge exploit, certain assets on the Harmony network are not
at parity with Ethereum, which affects the Aave V3 Harmony market.
</Trans>
}
warningType={'error'}
/>
Expand All @@ -132,7 +135,7 @@ export const BorrowAssetsList = () => {
<MarketWarning
linkHref={`https://snapshot.org/#/aave.eth/proposal/0xeefcd76e523391a14cfd0a79b531ea0a3faf0eb4a058e255fac13a2d224cc647`}
learnMore={true}
warningMessage={'Per the community, the Fantom market has been frozen.'}
warningMessage={<Trans>Per the community, the Fantom market has been frozen.</Trans>}
warningType={'error'}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,20 @@ export const SupplyAssetsList = () => {
learnMore={true}
linkHref={`https://governance.aave.com/t/harmony-horizon-bridge-exploit-consequences-to-aave-v3-harmony/8614`}
warningMessage={
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.'
<Trans>
Due to the Horizon bridge exploit, certain assets on the Harmony network are not
at parity with Ethereum, which affects the Aave V3 Harmony market.
</Trans>
}
warningType={'error'}
/>
) : supplyDisabled && currentNetworkConfig.name === 'Fantom' ? (
<MarketWarning
linkHref={`https://snapshot.org/#/aave.eth/proposal/0xeefcd76e523391a14cfd0a79b531ea0a3faf0eb4a058e255fac13a2d224cc647`}
learnMore={true}
warningMessage={'Per the community, the Fantom market has been frozen.'}
warningMessage={
<Trans>Per the community, the Fantom market has been frozen.</Trans>
}
warningType={'error'}
/>
) : user?.isInIsolationMode ? (
Expand Down
7 changes: 5 additions & 2 deletions src/modules/markets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export default function AssetsList() {
learnMore={true}
linkHref={`https://governance.aave.com/t/harmony-horizon-bridge-exploit-consequences-to-aave-v3-harmony/8614`}
warningMessage={
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.'
<Trans>
Due to the Horizon bridge exploit, certain assets on the Harmony network are not at
parity with Ethereum, which affects the Aave V3 Harmony market.
</Trans>
}
warningType={'error'}
/>
Expand All @@ -125,7 +128,7 @@ export default function AssetsList() {
<MarketWarning
linkHref={`https://snapshot.org/#/aave.eth/proposal/0xeefcd76e523391a14cfd0a79b531ea0a3faf0eb4a058e255fac13a2d224cc647`}
learnMore={true}
warningMessage={'Per the community, the Fantom market has been frozen.'}
warningMessage={<Trans>Per the community, the Fantom market has been frozen.</Trans>}
warningType={'error'}
/>
</Box>
Expand Down
7 changes: 5 additions & 2 deletions src/modules/reserve-overview/ReserveActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ export const ReserveActions = ({ underlyingAsset }: ReserveActionsProps) => {
learnMore={true}
linkHref={`https://governance.aave.com/t/harmony-horizon-bridge-exploit-consequences-to-aave-v3-harmony/8614`}
warningMessage={
'Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the Aave V3 Harmony market.'
<Trans>
Due to the Horizon bridge exploit, certain assets on the Harmony network are not at
parity with Ethereum, which affects the Aave V3 Harmony market.
</Trans>
}
warningType={'error'}
/>
Expand All @@ -323,7 +326,7 @@ export const ReserveActions = ({ underlyingAsset }: ReserveActionsProps) => {
<MarketWarning
linkHref={`https://snapshot.org/#/aave.eth/proposal/0xeefcd76e523391a14cfd0a79b531ea0a3faf0eb4a058e255fac13a2d224cc647`}
learnMore={true}
warningMessage={'Per the community, the Fantom market has been frozen.'}
warningMessage={<Trans>Per the community, the Fantom market has been frozen.</Trans>}
warningType={'error'}
/>
</Row>
Expand Down

0 comments on commit 60c4ae9

Please sign in to comment.