mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-14 03:24:06 +00:00
Make modal use markdown
This commit is contained in:
parent
c4306787f8
commit
4fc425b286
|
@ -3,6 +3,7 @@ import { modalMixin } from "../mixins/modal-mixin";
|
||||||
import { adultConsentLocalStorageKey } from "../../config";
|
import { adultConsentLocalStorageKey } from "../../config";
|
||||||
import { setIsoData } from "@utils/app";
|
import { setIsoData } from "@utils/app";
|
||||||
import { IsoDataOptionalSite } from "../../interfaces";
|
import { IsoDataOptionalSite } from "../../interfaces";
|
||||||
|
import { mdToHtml } from "../../markdown";
|
||||||
|
|
||||||
interface AdultConsentModalProps {
|
interface AdultConsentModalProps {
|
||||||
contentWarning: string;
|
contentWarning: string;
|
||||||
|
@ -29,11 +30,20 @@ class AdultConsentModalInner extends Component<AdultConsentModalProps, any> {
|
||||||
data-bs-backdrop="static"
|
data-bs-backdrop="static"
|
||||||
ref={this.modalDivRef}
|
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-content">
|
||||||
<div className="modal-body text-center align-middle text-body">
|
<header className="modal-header">
|
||||||
{contentWarning}
|
<h3 className="modal-title">Content Warning</h3>
|
||||||
</div>
|
</header>
|
||||||
|
<div
|
||||||
|
className="modal-body text-center align-middle text-body"
|
||||||
|
dangerouslySetInnerHTML={mdToHtml(contentWarning, () =>
|
||||||
|
this.forceUpdate(),
|
||||||
|
)}
|
||||||
|
/>
|
||||||
<footer className="modal-footer">
|
<footer className="modal-footer">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
@ -86,6 +86,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
||||||
allowed_instances: this.props.allowedInstances?.map(i => i.domain),
|
allowed_instances: this.props.allowedInstances?.map(i => i.domain),
|
||||||
blocked_instances: this.props.blockedInstances?.map(i => i.domain),
|
blocked_instances: this.props.blockedInstances?.map(i => i.domain),
|
||||||
blocked_urls: this.props.siteRes.blocked_urls.map(u => u.url),
|
blocked_urls: this.props.siteRes.blocked_urls.map(u => u.url),
|
||||||
|
content_warning: this.props.siteRes.site_view.site.content_warning,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue