Actionable toasts
This commit is contained in:
parent
d542f450a1
commit
b9134f8332
11 changed files with 148 additions and 59 deletions
|
@ -5,14 +5,32 @@ import React from 'react';
|
|||
import { LocalizerType } from '../types/Util';
|
||||
import { Toast } from './Toast';
|
||||
|
||||
type PropsType = {
|
||||
export type ToastPropsType = {
|
||||
undo: () => unknown;
|
||||
};
|
||||
|
||||
export type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
onClose: () => unknown;
|
||||
};
|
||||
} & ToastPropsType;
|
||||
|
||||
export const ToastConversationArchived = ({
|
||||
i18n,
|
||||
onClose,
|
||||
undo,
|
||||
}: PropsType): JSX.Element => {
|
||||
return <Toast onClose={onClose}>{i18n('conversationArchived')}</Toast>;
|
||||
return (
|
||||
<Toast
|
||||
toastAction={{
|
||||
label: i18n('conversationArchivedUndo'),
|
||||
onClick: () => {
|
||||
undo();
|
||||
onClose();
|
||||
},
|
||||
}}
|
||||
onClose={onClose}
|
||||
>
|
||||
{i18n('conversationArchived')}
|
||||
</Toast>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue