Add support for flash messages utilizing redux
This commit is contained in:
parent
b93b40ba31
commit
435626f4b7
15 changed files with 268 additions and 34 deletions
|
@ -1,14 +1,18 @@
|
|||
import * as React from 'react';
|
||||
|
||||
export type FlashMessageType = 'success' | 'info' | 'warning' | 'error';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
message: string;
|
||||
type?: 'success' | 'info' | 'warning' | 'error';
|
||||
children: string;
|
||||
type?: FlashMessageType;
|
||||
}
|
||||
|
||||
export default ({ title, message, type }: Props) => (
|
||||
export default ({ title, children, type }: Props) => (
|
||||
<div className={`lg:inline-flex alert ${type}`} role={'alert'}>
|
||||
{title && <span className={'title'}>{title}</span>}
|
||||
<span className={'message'}>{message}</span>
|
||||
<span className={'message'}>
|
||||
{children}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue