1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/app/beta-header/index.js

65 lines
1.5 KiB
JavaScript
Raw Normal View History

import React from 'react';
import { useI18nContext } from '../../../hooks/useI18nContext';
import Box from '../../ui/box/box';
import {
TextVariant,
Color,
BLOCK_SIZES,
DISPLAY,
2023-02-27 17:42:02 +01:00
AlignItems,
IconColor,
TextColor,
} from '../../../helpers/constants/design-system';
import { BETA_BUGS_URL } from '../../../helpers/constants/beta';
import { hideBetaHeader } from '../../../store/actions';
import { Text } from '../../component-library/text/deprecated';
import { ButtonIcon, ButtonIconSize, IconName } from '../../component-library';
const BetaHeader = () => {
const t = useI18nContext();
return (
<Box
display={DISPLAY.FLEX}
width={BLOCK_SIZES.FULL}
backgroundColor={Color.warningDefault}
padding={2}
className="beta-header"
2023-02-27 17:42:02 +01:00
alignItems={AlignItems.center}
>
<Text
variant={TextVariant.bodySm}
as="h6"
className="beta-header__message"
color={TextColor.warningInverse}
>
{t('betaHeaderText', [
<a
href={BETA_BUGS_URL}
key="link"
target="_blank"
rel="noreferrer noopener"
>
{t('here')}
</a>,
])}
</Text>
2023-02-27 17:42:02 +01:00
<ButtonIcon
iconName={IconName.Close}
size={ButtonIconSize.Sm}
2023-02-27 17:42:02 +01:00
color={IconColor.warningInverse}
className="beta-header__button"
data-testid="beta-header-close"
onClick={() => {
hideBetaHeader();
}}
aria-label={t('close')}
2023-02-27 17:42:02 +01:00
/>
</Box>
);
};
export default BetaHeader;