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: Add different copy for tooltip when a snap is requesting a signature #27492

Merged
merged 16 commits into from
Nov 4, 2024
Merged
Prev Previous commit
Next Next commit
update other signature screens
  • Loading branch information
hmalik88 committed Sep 30, 2024
commit ad453eff51fd0626de6d8bd5f94c40993646531f
Original file line number Diff line number Diff line change
@@ -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();
@@ -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 ?? ''}
Original file line number Diff line number Diff line change
@@ -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 = () => {
@@ -54,6 +55,10 @@ const TypedSignInfo: React.FC = () => {
})();
}, [verifyingContract]);

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

return (
<>
{isPermit && useTransactionSimulations && <PermitSimulation />}
@@ -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>