diff --git a/src/components/structures/ToastContainer.tsx b/src/components/structures/ToastContainer.tsx
index b7b0b7c652..75cf4a51fc 100644
--- a/src/components/structures/ToastContainer.tsx
+++ b/src/components/structures/ToastContainer.tsx
@@ -58,7 +58,7 @@ export default class ToastContainer extends React.Component<{}, IState> {
let containerClasses;
if (totalCount !== 0) {
const topToast = this.state.toasts[0];
- const { title, icon, key, component, className, props } = topToast;
+ const { title, icon, key, component, className, props, supplyWholeBody } = topToast;
const toastClasses = classNames("mx_Toast_toast", {
"mx_Toast_hasIcon": icon,
[`mx_Toast_icon_${icon}`]: icon,
@@ -73,16 +73,22 @@ export default class ToastContainer extends React.Component<{}, IState> {
key,
toastKey: key,
});
- toast = (
-
-
{ title }
- { countIndicator }
-
-
{ React.createElement(component, toastProps) }
-
);
+
+ const content = React.createElement(component, toastProps);
+
+ toast = supplyWholeBody
+ ? content
+ :
+
+
{ title }
+ { countIndicator }
+
+
{ content }
+
;
containerClasses = classNames("mx_ToastContainer", {
"mx_ToastContainer_stacked": isStacked,
+ [className]: supplyWholeBody,
});
}
return toast
diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts
index 850c3cb026..e831be7203 100644
--- a/src/stores/ToastStore.ts
+++ b/src/stores/ToastStore.ts
@@ -22,11 +22,13 @@ export interface IToast {
key: string;
// higher priority number will be shown on top of lower priority
priority: number;
- title: string;
+ title?: string;
icon?: string;
component: C;
className?: string;
props?: Omit, "toastKey">; // toastKey is injected by ToastContainer
+ supplyWholeBody?: boolean;
+ content?: JSX.Element;
}
/**