diff --git a/web-app/src/components/Button/index.tsx b/web-app/src/components/Button/index.tsx index bb4aa7ae..3f63c9cb 100644 --- a/web-app/src/components/Button/index.tsx +++ b/web-app/src/components/Button/index.tsx @@ -9,6 +9,7 @@ interface Props { onClick?: () => void size?: 'small' | 'medium' | 'large' iconSize?: 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl' + warning?: boolean } const Button = (props: Props) => ( @@ -19,6 +20,7 @@ const Button = (props: Props) => ( style={props.style} size={props.size} iconSize={props.iconSize} + warning={props.warning} > {props.children} diff --git a/web-app/src/components/Error/index.tsx b/web-app/src/components/Error/index.tsx index 8da521fb..ad5ab3a4 100644 --- a/web-app/src/components/Error/index.tsx +++ b/web-app/src/components/Error/index.tsx @@ -7,12 +7,28 @@ import Button from '../../components/Button' const styles = { container: { - color: '#D8000C', - backgroundColor: '#FFBABA', + display: 'flex' as 'flex', + flexDirection: 'column' as 'column', + justifyContent: 'center' as 'center', + alignItems: 'center' as 'center', + border: '0.5rem solid #FFBABA', padding: '1rem', width: '100%', height: '100%', }, + content: { + textAlign: 'center' as 'center', + color: 'rgb(40, 40, 40);', + }, + options: { + display: 'flex' as 'flex', + flexDirection: 'column' as 'column', + alignItems: 'center', + }, + button: { + margin: '0.5rem', + width: '10rem', + }, } interface Props { @@ -34,15 +50,21 @@ const ErrorMarkdown = ({ error, send }: Props) => { return (
-

Error

- {error.message} +

Oops!

+
+ {error.message} +
+
+
{/* Actions */} - {error.actions && - error.actions.map((a) => ( - - ))} +
+ {error.actions && + error.actions.map((a) => ( + + ))} +
) } diff --git a/web-app/stories/Error.stories.tsx b/web-app/stories/Error.stories.tsx new file mode 100644 index 00000000..973bb959 --- /dev/null +++ b/web-app/stories/Error.stories.tsx @@ -0,0 +1,20 @@ +import * as E from '../../typings/error' +import { action } from '@storybook/addon-actions' +import { storiesOf } from '@storybook/react' +import React from 'react' +import ErrorView from '../src/components/Error' +import SideBarDecorator from './utils/SideBarDecorator' + +storiesOf('Error', module) + .addDecorator(SideBarDecorator) + .add('Error', () => { + const error: E.ErrorMessage = { + type: 'UnknownError', + message: '### Message summary\n\nSome message about what went wrong under here', + actions: [ + { label: 'First', transition: 'FIRST' }, + { label: 'Second', transition: 'SECOND' }, + ], + } + return + })