1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/snaps/install-error/install-error.js
David Drazic 354788510e
[FLASK] Update UI (for audit) (UI facelift) (#19388)
* Update UI (for audit)

Revert yarn.lock change

Update e2e tests with new copy for a button

Make UI changes to custom Snap UI

Update UI on snap installation success page

Fix icon on installation success

Fix snap name font weight in installation page

Add UI changes for Snap installation failed page

Add new copy for snap installation screen

Update e2e tests OK button name

Update OK button names in e2e tests

Return previous functionality of update flow

Add error message handling for update screens

* Fix after rebase

* Fix messages.json update message

* Revert SCSS changes

* Refactor failed and success screen rendering
2023-06-06 12:15:20 +02:00

58 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../../ui/box/box';
import {
AlignItems,
BackgroundColor,
BLOCK_SIZES,
FLEX_DIRECTION,
FONT_WEIGHT,
IconColor,
JustifyContent,
TextAlign,
TextVariant,
} from '../../../../helpers/constants/design-system';
import ActionableMessage from '../../../ui/actionable-message/actionable-message';
import { AvatarIcon, IconSize, Text } from '../../../component-library';
const InstallError = ({ title, error, description, iconName }) => {
return (
<Box
flexDirection={FLEX_DIRECTION.COLUMN}
alignItems={AlignItems.center}
justifyContent={JustifyContent.center}
height={BLOCK_SIZES.FULL}
padding={2}
>
{iconName && (
<AvatarIcon
iconName={iconName}
size={IconSize.Xl}
iconProps={{
size: IconSize.Xl,
}}
color={IconColor.errorDefault}
backgroundColor={BackgroundColor.errorMuted}
marginBottom={4}
/>
)}
<Text fontWeight={FONT_WEIGHT.BOLD} variant={TextVariant.headingLg}>
{title}
</Text>
{description && <Text textAlign={TextAlign.Center}>{description}</Text>}
<Box padding={2}>
<ActionableMessage type="danger" message={error} />
</Box>
</Box>
);
};
InstallError.propTypes = {
title: PropTypes.node.isRequired,
error: PropTypes.string.isRequired,
description: PropTypes.string,
iconName: PropTypes.string,
};
export default InstallError;