diff --git a/src/shared/components/home/legal.tsx b/src/shared/components/home/legal.tsx new file mode 100644 index 00000000..dc99e1dc --- /dev/null +++ b/src/shared/components/home/legal.tsx @@ -0,0 +1,32 @@ +import { Component } from "inferno"; +import { GetSiteResponse } from "lemmy-js-client"; +import { i18n } from "../../i18next"; +import { md, setIsoData } from "../../utils"; + +interface LegalState { + siteRes: GetSiteResponse; +} + +export class Legal extends Component { + 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 ( +
+ {md(this.state.siteRes.site_view.site.legal_information)} +
+ ); + } +} diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 50797e6f..171cbc16 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -39,6 +39,7 @@ export class SiteForm extends Component { application_question: null, private_instance: null, default_theme: null, + legal_information: null, auth: authField(false), }, loading: false, @@ -76,6 +77,7 @@ export class SiteForm extends Component { application_question: site.application_question, private_instance: site.private_instance, default_theme: site.default_theme, + legal_information: site.legal_information, auth: authField(false), }; }