Skip to content

Commit

Permalink
* modal: change message type to custom content type.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Dec 17, 2024
1 parent e0349ae commit 9a3f1f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/modal/src/types/modal-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface ModalIframeOptions extends ModalOptions {
}

export interface ModalAlertOptions extends ModalCustomOptions {
message: string | {html: string};
message: CustomContentType;
icon?: string;
iconClass?: string;
actions?: ToolbarItemOptions[] | string | string[];
Expand Down
2 changes: 1 addition & 1 deletion lib/modal/src/vanilla/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class Modal<T extends ModalOptions = ModalOptions> extends ModalBase<T> {
}
const {type, message, icon, iconClass = 'icon-lg muted', actions = 'confirm', onClickAction, custom, key = '__alert', ...otherOptions} = options;
const customOptions = (typeof custom === 'function' ? custom() : custom) || {};
let content = typeof message === 'object' && message.html ? <div dangerouslySetInnerHTML={{__html: message.html}}></div> : (<div>{message}</div>);
let content = <CustomContent content={message} />;
if (icon) {
content = (
<div className={classes('modal-body row gap-4 items-center', customOptions.bodyClass)}>
Expand Down

0 comments on commit 9a3f1f8

Please sign in to comment.