1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Update snap install warning per designs and fix for popover component (#13844)

* updated snap install warning per designs, hotfix for popover component to remove box styles from it's scss file and introduce them as default props

* small fix
This commit is contained in:
Hassan Malik 2022-03-07 10:32:09 -05:00 committed by Erik Marks
parent 99604e5642
commit e795c29b3f
4 changed files with 51 additions and 38 deletions

View File

@ -7,10 +7,6 @@
gap: 0 16px; gap: 0 16px;
} }
&__content {
padding: 0 16px 24px;
}
&__footer { &__footer {
display: flex; display: flex;
flex-flow: row; flex-flow: row;

View File

@ -43,21 +43,22 @@ export default function SnapInstallWarning({ onCancel, onSubmit, snapName }) {
className="snap-install-warning" className="snap-install-warning"
title={t('areYouSure')} title={t('areYouSure')}
footer={<SnapInstallWarningFooter />} footer={<SnapInstallWarningFooter />}
headerProps={{ padding: [6, 6, 0] }}
contentProps={{ padding: [0, 6, 4] }}
footerProps={{ padding: [4, 6] }}
> >
<div className="snap-install-warning__content"> <Typography variant={TYPOGRAPHY.H6} boxProps={{ paddingBottom: 4 }}>
<Typography variant={TYPOGRAPHY.H6} boxProps={{ paddingBottom: 4 }}> {t('snapInstallWarningCheck')}
{t('snapInstallWarningCheck')} </Typography>
</Typography> <div className="checkbox-label">
<div className="checkbox-label"> <CheckBox
<CheckBox checked={isConfirmed}
checked={isConfirmed} id="warning-accept"
id="warning-accept" onClick={onCheckboxClicked}
onClick={onCheckboxClicked} />
/> <label htmlFor="warning-accept">
<label htmlFor="warning-accept"> {t('snapInstallWarningKeyAccess', [snapName])}
{t('snapInstallWarningKeyAccess', [snapName])} </label>
</label>
</div>
</div> </div>
</Popover> </Popover>
); );

View File

@ -21,12 +21,7 @@
} }
&-header { &-header {
display: flex;
padding: 24px 16px 16px;
flex-direction: column;
background: white;
position: relative; position: relative;
border-radius: 10px;
&__title { &__title {
display: flex; display: flex;
@ -78,13 +73,8 @@
&-content { &-content {
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
display: flex;
flex: 1; flex: 1;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
align-content: stretch; align-content: stretch;
border-radius: 10px;
} }
&-container { &-container {
@ -100,11 +90,7 @@
} }
&-footer { &-footer {
display: flex;
flex-direction: row;
justify-content: space-between;
border-top: 1px solid #d2d8dd; border-top: 1px solid #d2d8dd;
padding: 16px 24px 24px;
> :only-child { > :only-child {
margin: 0 auto; margin: 0 auto;

View File

@ -4,6 +4,33 @@ import PropTypes from 'prop-types';
import classnames from 'classnames'; import classnames from 'classnames';
import { useI18nContext } from '../../../hooks/useI18nContext'; import { useI18nContext } from '../../../hooks/useI18nContext';
import Box from '../box'; import Box from '../box';
import {
ALIGN_ITEMS,
FLEX_DIRECTION,
JUSTIFY_CONTENT,
} from '../../../helpers/constants/design-system';
const defaultHeaderProps = {
padding: [6, 4, 4],
display: 'flex',
flexDirection: FLEX_DIRECTION.COLUMN,
backgroundColor: 'white',
borderRadius: 'xl',
};
const defaultContentProps = {
display: 'flex',
flexDirection: FLEX_DIRECTION.COLUMN,
justifyContent: JUSTIFY_CONTENT.FLEX_START,
alignItems: ALIGN_ITEMS.STRETCH,
borderRadius: 'xl',
};
const defaultFooterProps = {
display: 'flex',
justifyContent: JUSTIFY_CONTENT.SPACE_BETWEEN,
padding: [4, 6, 6],
};
const Popover = ({ const Popover = ({
title, title,
@ -19,15 +46,18 @@ const Popover = ({
CustomBackground, CustomBackground,
popoverRef, popoverRef,
centerTitle, centerTitle,
headerProps = {}, headerProps = defaultHeaderProps,
contentProps = {}, contentProps = defaultContentProps,
footerProps = {}, footerProps = defaultFooterProps,
}) => { }) => {
const t = useI18nContext(); const t = useI18nContext();
const showHeader = title || onBack || subtitle || onClose; const showHeader = title || onBack || subtitle || onClose;
const Header = () => { const Header = () => {
return ( return (
<Box {...headerProps} className="popover-header"> <Box
{...{ ...defaultHeaderProps, ...headerProps }}
className="popover-header"
>
<div <div
className={classnames( className={classnames(
'popover-header__title', 'popover-header__title',
@ -76,7 +106,7 @@ const Popover = ({
{children ? ( {children ? (
<Box <Box
className={classnames('popover-content', contentClassName)} className={classnames('popover-content', contentClassName)}
{...contentProps} {...{ ...defaultContentProps, ...contentProps }}
> >
{children} {children}
</Box> </Box>
@ -84,7 +114,7 @@ const Popover = ({
{footer ? ( {footer ? (
<Box <Box
className={classnames('popover-footer', footerClassName)} className={classnames('popover-footer', footerClassName)}
{...footerProps} {...{ ...defaultFooterProps, ...footerProps }}
> >
{footer} {footer}
</Box> </Box>