1
0
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:
George Marshall 2023-05-09 14:09:10 -07:00 committed by GitHub
parent a1ff530430
commit 62ffd8022a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 6 deletions

View File

@ -9,11 +9,11 @@ exports[`ModalHeader should render ModalHeader correctly 1`] = `
<div <div
class="box box--flex-direction-row box--width-full" 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" class="box mm-text mm-text--heading-sm mm-text--text-align-center box--flex-direction-row box--color-text-default"
> >
Modal header Modal header
</h4> </header>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,13 @@
import React from 'react'; import React from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import { HeaderBase, Text, ButtonIcon, ButtonIconSize, IconName } from '..'; import {
HeaderBase,
Text,
ButtonIcon,
ButtonIconSize,
IconName,
ValidTag,
} from '..';
import { import {
TextVariant, TextVariant,
TextAlign, TextAlign,
@ -50,7 +57,11 @@ export const ModalHeader: React.FC<ModalHeaderProps> = ({
{...props} {...props}
> >
{typeof children === 'string' ? ( {typeof children === 'string' ? (
<Text variant={TextVariant.headingSm} textAlign={TextAlign.Center}> <Text
as={ValidTag.Header}
variant={TextVariant.headingSm}
textAlign={TextAlign.Center}
>
{children} {children}
</Text> </Text>
) : ( ) : (

View File

@ -3,6 +3,7 @@
exports[`ModalOverlay should match snapshot 1`] = ` exports[`ModalOverlay should match snapshot 1`] = `
<div> <div>
<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" class="box mm-modal-overlay box--flex-direction-row box--width-full box--height-full box--background-color-overlay-default"
/> />
</div> </div>

View File

@ -1,7 +1,8 @@
.mm-modal-overlay { .mm-modal-overlay {
position: absolute; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: $modal-z-index;
} }

View File

@ -21,6 +21,7 @@ export const ModalOverlay: React.FC<ModalOverlayProps> = ({
width={BLOCK_SIZES.FULL} width={BLOCK_SIZES.FULL}
height={BLOCK_SIZES.FULL} height={BLOCK_SIZES.FULL}
onClick={onClick} onClick={onClick}
aria-hidden="true"
{...props} {...props}
/> />
); );

View File

@ -41,6 +41,7 @@ export enum ValidTag {
Ul = 'ul', Ul = 'ul',
Label = 'label', Label = 'label',
Input = 'input', Input = 'input',
Header = 'header',
} }
export interface TextProps extends BoxProps { export interface TextProps extends BoxProps {

View File

@ -51,7 +51,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 1050; z-index: $modal-z-index;
} }
&-footer { &-footer {

View File

@ -10,3 +10,4 @@ $main-container-z-index: 18;
$send-card-z-index: 20; $send-card-z-index: 20;
$sidebar-z-index: 26; $sidebar-z-index: 26;
$sidebar-overlay-z-index: 25; $sidebar-overlay-z-index: 25;
$modal-z-index: 1050;