Skip to content

Commit

Permalink
update other signature screens
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Sep 30, 2024
1 parent b40f764 commit ad453ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { useConfirmContext } from '../../../../context/confirm';
import { ConfirmInfoRowTypedSignDataV1 } from '../../row/typed-sign-data-v1/typedSignDataV1';
import { ConfirmInfoSection } from '../../../../../../components/app/confirm/info/row/section';
import { isSnapId } from '../../../../../../helpers/utils/snaps';

const TypedSignV1Info: React.FC = () => {
const t = useI18nContext();
Expand All @@ -23,14 +24,18 @@ const TypedSignV1Info: React.FC = () => {
return null;
}

const toolTipMessage = isSnapId(currentConfirmation.msgParams.origin)
? t('requestfromInfoSnap')
: t('requestFromInfo');

return (
<>
<ConfirmInfoSection>
<ConfirmInfoAlertRow
alertKey={RowAlertKey.RequestFrom}
ownerId={currentConfirmation.id}
label={t('requestFrom')}
tooltip={t('requestFromInfo')}
tooltip={toolTipMessage}
>
<ConfirmInfoRowUrl
url={currentConfirmation.msgParams?.origin ?? ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useConfirmContext } from '../../../../context/confirm';
import { selectUseTransactionSimulations } from '../../../../selectors/preferences';
import { ConfirmInfoRowTypedSignData } from '../../row/typed-sign-data/typedSignData';
import { ConfirmInfoSection } from '../../../../../../components/app/confirm/info/row/section';
import { isSnapId } from '../../../../../../helpers/utils/snaps';
import { PermitSimulation } from './permit-simulation';

const TypedSignInfo: React.FC = () => {
Expand Down Expand Up @@ -54,6 +55,10 @@ const TypedSignInfo: React.FC = () => {
})();
}, [verifyingContract]);

const toolTipMessage = isSnapId(currentConfirmation.msgParams.origin)
? t('requestfromInfoSnap')
: t('requestFromInfo');

return (
<>
{isPermit && useTransactionSimulations && <PermitSimulation />}
Expand All @@ -70,7 +75,7 @@ const TypedSignInfo: React.FC = () => {
alertKey={RowAlertKey.RequestFrom}
ownerId={currentConfirmation.id}
label={t('requestFrom')}
tooltip={t('requestFromInfo')}
tooltip={toolTipMessage}
>
<ConfirmInfoRowUrl url={currentConfirmation.msgParams.origin} />
</ConfirmInfoAlertRow>
Expand Down

0 comments on commit ad453ef

Please sign in to comment.