Skip to content

fix: Permit signature re-design papercuts #25383

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

Merged
merged 7 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ import useAlerts from '../../../../../hooks/useAlerts';
import { confirmSelector } from '../../../selectors';
import { getConfirmationSender } from '../utils';

function getIconName(hasUnconfirmedAlerts: boolean): IconName {
return hasUnconfirmedAlerts ? IconName.SecuritySearch : IconName.Danger;
}

const ConfirmButton = ({
alertOwnerId = '',
disabled,
Expand Down Expand Up @@ -68,9 +64,7 @@ const ConfirmButton = ({
<Button
block
data-testid="confirm-footer-button"
startIconName={
hasDangerAlerts ? getIconName(hasUnconfirmedDangerAlerts) : undefined
}
startIconName={hasDangerAlerts ? IconName.Danger : undefined}
onClick={hasDangerAlerts ? handleOpenConfirmModal : onSubmit}
danger={hasDangerAlerts}
size={ButtonSize.Lg}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ exports[`Info renders info section for typed sign request 1`] = `
class="mm-box mm-box--margin-bottom-4 mm-box--padding-0 mm-box--background-color-background-default mm-box--rounded-md"
>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`Info renders info section for typed sign request 1`] = `
</div>
</div>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`TypedSignInfo renders origin for typed sign data request 1`] = `
class="mm-box mm-box--margin-bottom-4 mm-box--padding-0 mm-box--background-color-background-default mm-box--rounded-md"
>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -50,7 +50,7 @@ exports[`TypedSignInfo renders origin for typed sign data request 1`] = `
</div>
</div>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -439,7 +439,7 @@ exports[`TypedSignInfo should render message for typed sign v3 request 1`] = `
class="mm-box mm-box--margin-bottom-4 mm-box--padding-0 mm-box--background-color-background-default mm-box--rounded-md"
>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -481,7 +481,7 @@ exports[`TypedSignInfo should render message for typed sign v3 request 1`] = `
</div>
</div>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -870,7 +870,7 @@ exports[`TypedSignInfo should render message for typed sign v4 request 1`] = `
class="mm-box mm-box--margin-bottom-4 mm-box--padding-0 mm-box--background-color-background-default mm-box--rounded-md"
>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -912,7 +912,7 @@ exports[`TypedSignInfo should render message for typed sign v4 request 1`] = `
</div>
</div>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ exports[`PermitSimulation renders component correctly 1`] = `
</div>
<div
class="mm-box"
style="align-self: flex-end; margin-left: auto;"
>
<div
class="mm-box mm-box--display-flex"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const PermitSimulation: React.FC = () => {
<ConfirmInfoRowText text={t('permitSimulationDetailInfo')} />
</ConfirmInfoRow>
<ConfirmInfoRow label={t('approve')}>
<Box>
<Box style={{ alignSelf: 'flex-end', marginLeft: 'auto' }}>
<Box display={Display.Flex}>
<Box display={Display.Inline} marginInlineEnd={1}>
<Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ const TypedSignInfo: React.FC = () => {
>
{isPermit && (
<>
<Box padding={2}>
<Box paddingInline={2}>
<ConfirmInfoRow label={t('spender')}>
<ConfirmInfoRowAddress address={spender} />
</ConfirmInfoRow>
</Box>
<ConfirmInfoRowDivider />
</>
)}
<Box padding={2}>
<Box paddingInline={2}>
<ConfirmInfoRow
label={t('requestFrom')}
tooltip={t('requestFromInfo')}
Expand All @@ -70,7 +70,7 @@ const TypedSignInfo: React.FC = () => {
</ConfirmInfoRow>
</Box>
{isValidAddress(verifyingContract) && (
<Box padding={2}>
<Box paddingInline={2}>
<ConfirmInfoRow label={t('interactingWith')}>
<ConfirmInfoRowAddress address={verifyingContract} />
</ConfirmInfoRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ exports[`Confirm should match snapshot for typed sign signature 1`] = `
class="mm-box mm-box--margin-bottom-4 mm-box--padding-0 mm-box--background-color-background-default mm-box--rounded-md"
>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down Expand Up @@ -423,7 +423,7 @@ exports[`Confirm should match snapshot for typed sign signature 1`] = `
</div>
</div>
<div
class="mm-box mm-box--padding-2"
class="mm-box mm-box--padding-inline-2"
>
<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--color-text-default mm-box--rounded-lg"
Expand Down