Skip to content

Commit

Permalink
fix signature unwanted empty div
Browse files Browse the repository at this point in the history
  • Loading branch information
OGPoyraz committed Jan 10, 2025
1 parent 46bf1cf commit 1bf2cff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getSmartTransactionsOptInStatusInternal,
getSmartTransactionsMigrationAppliedInternal,
} from '../../../../../shared/modules/selectors/smart-transactions';
import { Box } from '../../../../components/component-library';

Check failure on line 21 in ui/pages/confirmations/components/smart-transactions-banner-alert/smart-transactions-banner-alert.tsx

View workflow job for this annotation

GitHub Actions / Test lint / Test lint

'/home/runner/work/metamask-extension/metamask-extension/ui/components/component-library/index.ts' imported multiple times

type MarginType = 'default' | 'none' | 'noTop' | 'onlyTop';

Expand Down Expand Up @@ -95,27 +96,29 @@ export const SmartTransactionsBannerAlert: React.FC<SmartTransactionsBannerAlert
};

return (
<BannerAlert
severity={BannerAlertSeverity.Info}
onClose={dismissAlert}
data-testid="smart-transactions-banner-alert"
style={getMarginStyle()}
>
<Text fontWeight={FontWeight.Bold}>
{t('smartTransactionsEnabledTitle')}
</Text>
<Text as="p">
<ButtonLink
href={SMART_TRANSACTIONS_LEARN_MORE_URL}
onClick={dismissAlert}
externalLink
style={{ height: 'unset', verticalAlign: 'unset' }}
>
{t('smartTransactionsEnabledLink')}
</ButtonLink>
{t('smartTransactionsEnabledDescription')}
</Text>
</BannerAlert>
<Box className="transaction-alerts">
<BannerAlert
severity={BannerAlertSeverity.Info}
onClose={dismissAlert}
data-testid="smart-transactions-banner-alert"
style={getMarginStyle()}
>
<Text fontWeight={FontWeight.Bold}>
{t('smartTransactionsEnabledTitle')}
</Text>
<Text as="p">
<ButtonLink
href={SMART_TRANSACTIONS_LEARN_MORE_URL}
onClick={dismissAlert}
externalLink
style={{ height: 'unset', verticalAlign: 'unset' }}
>
{t('smartTransactionsEnabledLink')}
</ButtonLink>
{t('smartTransactionsEnabledDescription')}
</Text>
</BannerAlert>
</Box>
);
});

Expand Down
24 changes: 0 additions & 24 deletions ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ exports[`Confirm matches snapshot for signature - personal sign type 1`] = `
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -374,9 +371,6 @@ exports[`Confirm should match snapshot for signature - typed sign - V4 - PermitB
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -960,9 +954,6 @@ exports[`Confirm should match snapshot for signature - typed sign - V4 - PermitS
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -1495,9 +1486,6 @@ exports[`Confirm should match snapshot for signature - typed sign - V4 1`] = `
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -2515,9 +2503,6 @@ exports[`Confirm should match snapshot for signature - typed sign - permit 1`] =
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -3044,9 +3029,6 @@ exports[`Confirm should match snapshot signature - typed sign - order 1`] = `
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -3870,9 +3852,6 @@ exports[`Confirm should render SmartTransactionsBannerAlert for transaction type
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down Expand Up @@ -3987,9 +3966,6 @@ exports[`Confirm should render SmartTransactionsBannerAlert for transaction type
</div>
</div>
</div>
<div
class="mm-box transaction-alerts"
/>
<div
class="mm-box mm-box--width-full mm-box--height-full mm-box--background-color-background-alternative"
style="min-height: 0; overflow: hidden; position: relative;"
Expand Down
5 changes: 1 addition & 4 deletions ui/pages/confirmations/confirm/confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Title } from '../components/confirm/title';
import EditGasFeePopover from '../components/edit-gas-fee-popover';
import { ConfirmContextProvider, useConfirmContext } from '../context/confirm';
import { ConfirmNav } from '../components/confirm/nav/nav';
import { Box } from '../../../components/component-library';

const EIP1559TransactionGasModal = () => {
return (
Expand Down Expand Up @@ -55,9 +54,7 @@ const Confirm = () => (
<Page className="confirm_wrapper">
<ConfirmNav />
<Header />
<Box className="transaction-alerts">
<SmartTransactionsBannerAlert marginType="noTop" />
</Box>
<SmartTransactionsBannerAlert marginType="noTop" />
<ScrollToBottom>
{
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
Expand Down

0 comments on commit 1bf2cff

Please sign in to comment.