add legal_info field to SiteForm, add missing file

This commit is contained in:
Felix Ableitner 2022-05-23 13:10:31 +02:00
parent 39379eb786
commit 0f62113ff1
2 changed files with 34 additions and 0 deletions

View file

@ -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<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 (
<div class="container">
{md(this.state.siteRes.site_view.site.legal_information)}
</div>
);
}
}

View file

@ -39,6 +39,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
application_question: null, application_question: null,
private_instance: null, private_instance: null,
default_theme: null, default_theme: null,
legal_information: null,
auth: authField(false), auth: authField(false),
}, },
loading: false, loading: false,
@ -76,6 +77,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
application_question: site.application_question, application_question: site.application_question,
private_instance: site.private_instance, private_instance: site.private_instance,
default_theme: site.default_theme, default_theme: site.default_theme,
legal_information: site.legal_information,
auth: authField(false), auth: authField(false),
}; };
} }