2023-06-21 22:28:24 +00:00
|
|
|
import { setIsoData } from "@utils/app";
|
2022-05-26 20:48:58 +00:00
|
|
|
import { Component } from "inferno";
|
|
|
|
import { GetSiteResponse } from "lemmy-js-client";
|
2023-06-21 22:28:24 +00:00
|
|
|
import { mdToHtml } from "../../markdown";
|
2023-06-23 19:16:04 +00:00
|
|
|
import { FirstLoadService, I18NextService } from "../../services";
|
2022-05-26 20:48:58 +00:00
|
|
|
import { HtmlTags } from "../common/html-tags";
|
|
|
|
|
|
|
|
interface LegalState {
|
|
|
|
siteRes: GetSiteResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Legal extends Component<any, LegalState> {
|
|
|
|
private isoData = setIsoData(this.context);
|
2023-01-04 16:56:24 +00:00
|
|
|
state: LegalState = {
|
2022-05-26 20:48:58 +00:00
|
|
|
siteRes: this.isoData.site_res,
|
|
|
|
};
|
|
|
|
|
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
2023-06-23 19:16:04 +00:00
|
|
|
|
|
|
|
FirstLoadService.isFirstLoad;
|
2022-05-26 20:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
get documentTitle(): string {
|
2023-06-22 00:54:35 +00:00
|
|
|
return I18NextService.i18n.t("legal_information");
|
2022-05-26 20:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2023-06-05 21:31:12 +00:00
|
|
|
const legal = this.state.siteRes.site_view.local_site.legal_information;
|
2022-05-26 20:48:58 +00:00
|
|
|
return (
|
2023-06-20 18:46:16 +00:00
|
|
|
<div className="legal container-lg">
|
2022-05-26 20:48:58 +00:00
|
|
|
<HtmlTags
|
|
|
|
title={this.documentTitle}
|
|
|
|
path={this.context.router.route.match.url}
|
|
|
|
/>
|
2023-01-04 16:56:24 +00:00
|
|
|
{legal && (
|
|
|
|
<div className="md-div" dangerouslySetInnerHTML={mdToHtml(legal)} />
|
|
|
|
)}
|
2022-05-26 20:48:58 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|