mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-08 17:44:16 +00:00
add legal_info field to SiteForm, add missing file
This commit is contained in:
parent
6e57314179
commit
5f3ec220d1
32
src/shared/components/home/legal.tsx
Normal file
32
src/shared/components/home/legal.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue