Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gnosis safe not support chain alert #1769

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _raw/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,9 @@
"reconnect": "If it doesn't work, please try <1>reconnecting from the beginning.</1>"
},
"howToSwitch": "How to switch"
},
"GnosisWrongChainAlertBar": {
"warning": "Safe address does not support {{chain}}"
}
},
"nft": {
Expand Down
3 changes: 3 additions & 0 deletions _raw/locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@
"reconnect": "如果无法连接,请尝试<1>从头开始重新连接</1>"
},
"howToSwitch": "如何切换"
},
"GnosisWrongChainAlertBar": {
"warning": "Safe 地址不支持 {{chain}}"
}
},
"chainList": {
Expand Down
14 changes: 11 additions & 3 deletions src/ui/views/Dashboard/components/GnosisWrongChainAlertBar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { useRabbySelector } from '@/ui/store';
import { CHAINS, CHAINS_ENUM } from '@debank/common';
import React from 'react';
import { useTranslation } from 'react-i18next';
import IconAlert from 'ui/assets/alert.svg';

const GnosisWrongChainAllert = () => {
const GnosisWrongChainAlert = () => {
const { t } = useTranslation();
const currentConnection = useRabbySelector(
(state) => state.chains.currentConnection
);
const chain = CHAINS[currentConnection?.chain || CHAINS_ENUM.ETH];

return (
<div className="gnosis-wrong-chain-alert">
<img className="icon-alert" src={IconAlert} />
{t('GnosisSwitchChainWarning')}
{t('page.dashboard.GnosisWrongChainAlertBar.warning', {
chain: chain?.name,
})}
</div>
);
};

export default GnosisWrongChainAllert;
export default GnosisWrongChainAlert;