Make modal use markdown

This commit is contained in:
SleeplessOne1917 2024-04-13 20:59:02 -04:00
parent c4306787f8
commit 4fc425b286
2 changed files with 15 additions and 4 deletions

View file

@ -3,6 +3,7 @@ import { modalMixin } from "../mixins/modal-mixin";
import { adultConsentLocalStorageKey } from "../../config";
import { setIsoData } from "@utils/app";
import { IsoDataOptionalSite } from "../../interfaces";
import { mdToHtml } from "../../markdown";
interface AdultConsentModalProps {
contentWarning: string;
@ -29,11 +30,20 @@ class AdultConsentModalInner extends Component<AdultConsentModalProps, any> {
data-bs-backdrop="static"
ref={this.modalDivRef}
>
<div className="modal-dialog modal-fullscreen-sm-down">
<div
className="modal-dialog modal-fullscreen-sm-down"
data-bs-backdrop="static"
>
<div className="modal-content">
<div className="modal-body text-center align-middle text-body">
{contentWarning}
</div>
<header className="modal-header">
<h3 className="modal-title">Content Warning</h3>
</header>
<div
className="modal-body text-center align-middle text-body"
dangerouslySetInnerHTML={mdToHtml(contentWarning, () =>
this.forceUpdate(),
)}
/>
<footer className="modal-footer">
<button
type="button"

View file

@ -86,6 +86,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
allowed_instances: this.props.allowedInstances?.map(i => i.domain),
blocked_instances: this.props.blockedInstances?.map(i => i.domain),
blocked_urls: this.props.siteRes.blocked_urls.map(u => u.url),
content_warning: this.props.siteRes.site_view.site.content_warning,
};
}