add legal_info field to SiteForm, add missing file

This commit is contained in:
Felix Ableitner 2022-05-23 13:10:31 +02:00 committed by Dessalines
parent 6e57314179
commit 5f3ec220d1
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

@ -42,6 +42,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
private_instance: null,
default_theme: null,
default_post_listing_type: null,
legal_information: null,
auth: authField(false),
},
loading: false,
@ -83,6 +84,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
private_instance: site.private_instance,
default_theme: site.default_theme,
default_post_listing_type: site.default_post_listing_type,
legal_information: site.legal_information,
auth: authField(false),
};
}