2022-06-21 21:42:29 +00:00
|
|
|
import { None } from "@sniptt/monads";
|
2022-05-26 20:48:58 +00:00
|
|
|
import { Component } from "inferno";
|
|
|
|
import { GetSiteResponse } from "lemmy-js-client";
|
|
|
|
import { i18n } from "../../i18next";
|
|
|
|
import { mdToHtml, setIsoData } from "../../utils";
|
|
|
|
import { HtmlTags } from "../common/html-tags";
|
|
|
|
|
|
|
|
interface LegalState {
|
|
|
|
siteRes: GetSiteResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Legal extends Component<any, LegalState> {
|
|
|
|
private isoData = setIsoData(this.context);
|
|
|
|
private emptyState: LegalState = {
|
|
|
|
siteRes: this.isoData.site_res,
|
|
|
|
};
|
|
|
|
|
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
|
|
|
this.state = this.emptyState;
|
|
|
|
}
|
|
|
|
|
|
|
|
get documentTitle(): string {
|
|
|
|
return i18n.t("legal_information");
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2022-09-22 15:03:35 +00:00
|
|
|
<div className="container">
|
2022-05-26 20:48:58 +00:00
|
|
|
<HtmlTags
|
|
|
|
title={this.documentTitle}
|
|
|
|
path={this.context.router.route.match.url}
|
2022-06-21 21:42:29 +00:00
|
|
|
description={None}
|
|
|
|
image={None}
|
2022-05-26 20:48:58 +00:00
|
|
|
/>
|
2022-06-21 21:42:29 +00:00
|
|
|
{this.state.siteRes.site_view.match({
|
|
|
|
some: siteView =>
|
|
|
|
siteView.site.legal_information.match({
|
|
|
|
some: legal => (
|
|
|
|
<div
|
|
|
|
className="md-div"
|
|
|
|
dangerouslySetInnerHTML={mdToHtml(legal)}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
none: <></>,
|
|
|
|
}),
|
|
|
|
none: <></>,
|
|
|
|
})}
|
2022-05-26 20:48:58 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|