diff --git a/js/src/common/components/Alert.tsx b/js/src/common/components/Alert.tsx index e206b591c..d9601b04e 100644 --- a/js/src/common/components/Alert.tsx +++ b/js/src/common/components/Alert.tsx @@ -3,6 +3,8 @@ import Button from './Button'; import listItems from '../helpers/listItems'; import extract from '../utils/extract'; import type Mithril from 'mithril'; +import classList from '../utils/classList'; +import app from '../app'; export interface AlertAttrs extends ComponentAttrs { /** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */ @@ -24,7 +26,7 @@ export default class Alert extends Component< const attrs = Object.assign({}, this.attrs); const type = extract(attrs, 'type'); - attrs.className = 'Alert Alert--' + type + ' ' + (attrs.className || ''); + attrs.className = classList('Alert', `Alert--${type}`, attrs.className); const content = extract(attrs, 'content') || vnode.children; const controls = (extract(attrs, 'controls') || []) as Mithril.Vnode[]; @@ -37,13 +39,20 @@ export default class Alert extends Component< const dismissControl: Mithril.Vnode[] = []; if (dismissible || dismissible === undefined) { - dismissControl.push(