mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Some style, accessibility and sematic html updates to modal sub components (#19034)
This commit is contained in:
parent
a1ff530430
commit
62ffd8022a
@ -9,11 +9,11 @@ exports[`ModalHeader should render ModalHeader correctly 1`] = `
|
||||
<div
|
||||
class="box box--flex-direction-row box--width-full"
|
||||
>
|
||||
<h4
|
||||
<header
|
||||
class="box mm-text mm-text--heading-sm mm-text--text-align-center box--flex-direction-row box--color-text-default"
|
||||
>
|
||||
Modal header
|
||||
</h4>
|
||||
</header>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,13 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { HeaderBase, Text, ButtonIcon, ButtonIconSize, IconName } from '..';
|
||||
import {
|
||||
HeaderBase,
|
||||
Text,
|
||||
ButtonIcon,
|
||||
ButtonIconSize,
|
||||
IconName,
|
||||
ValidTag,
|
||||
} from '..';
|
||||
import {
|
||||
TextVariant,
|
||||
TextAlign,
|
||||
@ -50,7 +57,11 @@ export const ModalHeader: React.FC<ModalHeaderProps> = ({
|
||||
{...props}
|
||||
>
|
||||
{typeof children === 'string' ? (
|
||||
<Text variant={TextVariant.headingSm} textAlign={TextAlign.Center}>
|
||||
<Text
|
||||
as={ValidTag.Header}
|
||||
variant={TextVariant.headingSm}
|
||||
textAlign={TextAlign.Center}
|
||||
>
|
||||
{children}
|
||||
</Text>
|
||||
) : (
|
||||
|
@ -3,6 +3,7 @@
|
||||
exports[`ModalOverlay should match snapshot 1`] = `
|
||||
<div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="box mm-modal-overlay box--flex-direction-row box--width-full box--height-full box--background-color-overlay-default"
|
||||
/>
|
||||
</div>
|
||||
|
@ -1,7 +1,8 @@
|
||||
.mm-modal-overlay {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: $modal-z-index;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ export const ModalOverlay: React.FC<ModalOverlayProps> = ({
|
||||
width={BLOCK_SIZES.FULL}
|
||||
height={BLOCK_SIZES.FULL}
|
||||
onClick={onClick}
|
||||
aria-hidden="true"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
@ -41,6 +41,7 @@ export enum ValidTag {
|
||||
Ul = 'ul',
|
||||
Label = 'label',
|
||||
Input = 'input',
|
||||
Header = 'header',
|
||||
}
|
||||
|
||||
export interface TextProps extends BoxProps {
|
||||
|
@ -51,7 +51,7 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1050;
|
||||
z-index: $modal-z-index;
|
||||
}
|
||||
|
||||
&-footer {
|
||||
|
@ -10,3 +10,4 @@ $main-container-z-index: 18;
|
||||
$send-card-z-index: 20;
|
||||
$sidebar-z-index: 26;
|
||||
$sidebar-overlay-z-index: 25;
|
||||
$modal-z-index: 1050;
|
||||
|
Loading…
Reference in New Issue
Block a user