Skip to content

Commit

Permalink
fix: gnosis safe not support chain alert (#1769)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 authored Sep 22, 2023
1 parent a248434 commit 3ef8ccb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
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;

0 comments on commit 3ef8ccb

Please sign in to comment.