Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Dec 18, 2024
1 parent f13f133 commit 9ccd589
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const TransactionActionList: React.FC<{
React.useEffect(() => {
if (requireData && 'extraState' in requireData) {
requireData.extraState.hasInteraction?.();
requireData.extraState.receiverHasTransfer?.();
}
}, []);

Expand Down
40 changes: 16 additions & 24 deletions src/ui/views/Approval/components/Actions/components/Values.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,20 @@ import { findChain } from '@/utils/chain';
import clsx from 'clsx';
import { copyAddress } from '@/ui/utils/clipboard';

const Boolean = ({ value }: { value: boolean }) => {
return <>{value ? 'Yes' : 'No'}</>;
const Boolean = ({ value }: { value: boolean | null }) => {
const { t } = useTranslation();

return (
<>
{value === null ? (
'loading'
) : value ? (
<>{t('page.signTx.yes')}</>
) : (
<>{t('page.signTx.no')}</>
)}
</>
);
};

const TokenAmountWrapper = styled.div`
Expand Down Expand Up @@ -432,29 +444,9 @@ const DisplayChain = ({ chainServerId }: { chainServerId: string }) => {
);
};

const Interacted = ({ value }: { value: boolean | null }) => {
const { t } = useTranslation();
return (
<span className="flex">
{value === null ? (
'loading'
) : value ? (
<>{t('page.signTx.yes')}</>
) : (
<>{t('page.signTx.no')}</>
)}
</span>
);
};
const Interacted = Boolean;

const Transacted = ({ value }: { value: boolean }) => {
const { t } = useTranslation();
return (
<span className="flex">
{value ? <>{t('page.signTx.yes')}</> : <>{t('page.signTx.no')}</>}
</span>
);
};
const Transacted = Boolean;

const TokenSymbol = ({
token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface ReceiverData {
} | null;
contract: Record<string, ContractDesc> | null;
usd_value: number;
hasTransfer: boolean;
hasTransfer: boolean | null;
isTokenContract: boolean;
name: string | null;
onTransferWhitelist: boolean;
Expand Down

0 comments on commit 9ccd589

Please sign in to comment.