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 alert when selected account is different from signing account in confirmation #28562

Merged
merged 15 commits into from
Nov 25, 2024
6 changes: 6 additions & 0 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,81 @@ exports[`<ApproveInfo /> renders component for approve request 1`] = `
</p>
</div>
</div>
<div
class="mm-box confirm-info-row mm-box--margin-top-2 mm-box--margin-bottom-2 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-flex mm-box--flex-direction-row mm-box--flex-wrap-wrap mm-box--justify-content-space-between mm-box--align-items-center mm-box--color-text-default mm-box--rounded-lg"
style="overflow-wrap: anywhere; min-height: 24px; position: relative; background: transparent;"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start mm-box--color-text-default"
>
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Signing in with
</p>
</div>
</div>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-account mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
>
<div
class="mm-avatar-account__jazzicon"
>
<div
style="border-radius: 50px; overflow: hidden; padding: 0px; margin: 0px; width: 16px; height: 16px; display: inline-block; background: rgb(24, 100, 242);"
>
<svg
height="16"
width="16"
x="0"
y="0"
>
<rect
fill="#C81420"
height="16"
transform="translate(-2.752618452452339 -2.6325616818687707) rotate(385.9 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#E9F500"
height="16"
transform="translate(5.337234703363199 6.214964079596694) rotate(184.5 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#FAB300"
height="16"
transform="translate(0.9077275996181156 -13.015140953188144) rotate(431.3 8 8)"
width="16"
x="0"
y="0"
/>
</svg>
</div>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-left-2 mm-box--color-inherit"
data-testid="confirm-info-row-display-name"
>
0x2e0D7...5d09B
</p>
</div>
</div>
</div>
<div
class="mm-box confirm-info-row mm-box--margin-top-2 mm-box--margin-bottom-2 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-flex mm-box--flex-direction-row mm-box--flex-wrap-wrap mm-box--justify-content-space-between mm-box--align-items-center mm-box--color-text-default mm-box--rounded-lg"
data-testid="transaction-details-recipient-row"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
MethodDataRow,
OriginRow,
RecipientRow,
SigningInWithRow,
} from '../../shared/transaction-details/transaction-details';
import { getIsRevokeSetApprovalForAll } from '../../utils';
import { useIsNFT } from '../hooks/use-is-nft';
Expand Down Expand Up @@ -81,6 +82,7 @@ export const ApproveDetails = ({
<ConfirmInfoSection data-testid="confirmation__approve-details">
<Spender isSetApprovalForAll={isSetApprovalForAll} />
<OriginRow />
<SigningInWithRow />
{showAdvancedDetails && (
<>
<RecipientRow />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React from 'react';
import { ConfirmInfoSection } from '../../../../../../../components/app/confirm/info/row/section';
import { OriginRow } from '../../shared/transaction-details/transaction-details';
import {
OriginRow,
SigningInWithRow,
} from '../../shared/transaction-details/transaction-details';

export const RevokeDetails = () => {
return (
<ConfirmInfoSection>
<OriginRow />
<SigningInWithRow />
</ConfirmInfoSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,81 @@ exports[`<BaseTransactionInfo /> renders component for contract interaction requ
</div>
</div>
</div>
<div
class="mm-box confirm-info-row mm-box--margin-top-2 mm-box--margin-bottom-2 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-flex mm-box--flex-direction-row mm-box--flex-wrap-wrap mm-box--justify-content-space-between mm-box--align-items-center mm-box--color-text-default mm-box--rounded-lg"
style="overflow-wrap: anywhere; min-height: 24px; position: relative; background: transparent;"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start mm-box--color-text-default"
>
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Signing in with
</p>
</div>
</div>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-account mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
>
<div
class="mm-avatar-account__jazzicon"
>
<div
style="border-radius: 50px; overflow: hidden; padding: 0px; margin: 0px; width: 16px; height: 16px; display: inline-block; background: rgb(24, 100, 242);"
>
<svg
height="16"
width="16"
x="0"
y="0"
>
<rect
fill="#C81420"
height="16"
transform="translate(-2.752618452452339 -2.6325616818687707) rotate(385.9 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#E9F500"
height="16"
transform="translate(5.337234703363199 6.214964079596694) rotate(184.5 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#FAB300"
height="16"
transform="translate(0.9077275996181156 -13.015140953188144) rotate(431.3 8 8)"
width="16"
x="0"
y="0"
/>
</svg>
</div>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-left-2 mm-box--color-inherit"
data-testid="confirm-info-row-display-name"
>
0x2e0D7...5d09B
</p>
</div>
</div>
</div>
</div>
<div
class="mm-box mm-box--margin-bottom-4 mm-box--padding-2 mm-box--background-color-background-default mm-box--rounded-md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,81 @@ exports[`PersonalSignInfo handle reverse string properly 1`] = `
</p>
</div>
</div>
<div
class="mm-box confirm-info-row mm-box--margin-top-2 mm-box--margin-bottom-2 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-flex mm-box--flex-direction-row mm-box--flex-wrap-wrap mm-box--justify-content-space-between mm-box--align-items-center mm-box--color-text-default mm-box--rounded-lg"
style="overflow-wrap: anywhere; min-height: 24px; position: relative; background: transparent;"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start mm-box--color-text-default"
>
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Signing in with
</p>
</div>
</div>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-account mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
>
<div
class="mm-avatar-account__jazzicon"
>
<div
style="border-radius: 50px; overflow: hidden; padding: 0px; margin: 0px; width: 16px; height: 16px; display: inline-block; background: rgb(250, 58, 0);"
>
<svg
height="16"
width="16"
x="0"
y="0"
>
<rect
fill="#18CDF2"
height="16"
transform="translate(-0.52419675189697 -1.6521420347302493) rotate(328.9 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#035E56"
height="16"
transform="translate(-9.149230854416022 5.2962309358743) rotate(176.2 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#F26602"
height="16"
transform="translate(8.333921009111961 -7.102569861498541) rotate(468.9 8 8)"
width="16"
x="0"
y="0"
/>
</svg>
</div>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-left-2 mm-box--color-inherit"
data-testid="confirm-info-row-display-name"
>
Test Account
</p>
</div>
</div>
</div>
</div>
<div
class="mm-box mm-box--margin-bottom-4 mm-box--padding-2 mm-box--background-color-background-default mm-box--rounded-md"
Expand Down Expand Up @@ -151,6 +226,81 @@ exports[`PersonalSignInfo renders correctly for personal sign request 1`] = `
</p>
</div>
</div>
<div
class="mm-box confirm-info-row mm-box--margin-top-2 mm-box--margin-bottom-2 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-flex mm-box--flex-direction-row mm-box--flex-wrap-wrap mm-box--justify-content-space-between mm-box--align-items-center mm-box--color-text-default mm-box--rounded-lg"
style="overflow-wrap: anywhere; min-height: 24px; position: relative; background: transparent;"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start mm-box--color-text-default"
>
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Signing in with
</p>
</div>
</div>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
>
<div
class="mm-box mm-text mm-avatar-base mm-avatar-base--size-xs mm-avatar-account mm-text--body-xs mm-text--text-transform-uppercase mm-box--display-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-full mm-box--border-color-transparent box--border-style-solid box--border-width-1"
>
<div
class="mm-avatar-account__jazzicon"
>
<div
style="border-radius: 50px; overflow: hidden; padding: 0px; margin: 0px; width: 16px; height: 16px; display: inline-block; background: rgb(250, 58, 0);"
>
<svg
height="16"
width="16"
x="0"
y="0"
>
<rect
fill="#18CDF2"
height="16"
transform="translate(-0.52419675189697 -1.6521420347302493) rotate(328.9 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#035E56"
height="16"
transform="translate(-9.149230854416022 5.2962309358743) rotate(176.2 8 8)"
width="16"
x="0"
y="0"
/>
<rect
fill="#F26602"
height="16"
transform="translate(8.333921009111961 -7.102569861498541) rotate(468.9 8 8)"
width="16"
x="0"
y="0"
/>
</svg>
</div>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-left-2 mm-box--color-inherit"
data-testid="confirm-info-row-display-name"
>
Test Account
</p>
</div>
</div>
</div>
</div>
<div
class="mm-box mm-box--margin-bottom-4 mm-box--padding-2 mm-box--background-color-background-default mm-box--rounded-md"
Expand Down
Loading