From c2e5c388a9ea5db62165cf32cab5fcf1f30c0943 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 25 May 2022 20:00:53 -0400 Subject: [PATCH] Moving legal to SiteForm. --- src/shared/components/app/footer.tsx | 2 +- src/shared/components/home/admin-settings.tsx | 46 ++----------------- src/shared/components/home/legal.tsx | 14 +++++- src/shared/components/home/site-form.tsx | 18 ++++++++ 4 files changed, 35 insertions(+), 45 deletions(-) diff --git a/src/shared/components/app/footer.tsx b/src/shared/components/app/footer.tsx index b23fdeef..601551b5 100644 --- a/src/shared/components/app/footer.tsx +++ b/src/shared/components/app/footer.tsx @@ -32,7 +32,7 @@ export class Footer extends Component { {i18n.t("modlog")} - {this.props.site.site_view.site.legal_information && ( + {this.props.site.site_view?.site.legal_information && (
  • {i18n.t("legal_information")} diff --git a/src/shared/components/home/admin-settings.tsx b/src/shared/components/home/admin-settings.tsx index 88796fef..cb784842 100644 --- a/src/shared/components/home/admin-settings.tsx +++ b/src/shared/components/home/admin-settings.tsx @@ -2,7 +2,6 @@ import autosize from "autosize"; import { Component, linkEvent } from "inferno"; import { BannedPersonsResponse, - EditSite, GetBannedPersons, GetSiteConfig, GetSiteConfigResponse, @@ -38,7 +37,6 @@ interface AdminSettingsState { siteRes: GetSiteResponse; siteConfigRes: GetSiteConfigResponse; siteConfigHjson: string; - legalInfo: string; loading: boolean; banned: PersonViewSafe[]; siteConfigLoading: boolean; @@ -47,13 +45,11 @@ interface AdminSettingsState { export class AdminSettings extends Component { private siteConfigTextAreaId = `site-config-${randomStr()}`; - private legalInfoTextAreaId = `legal-info-${randomStr()}`; private isoData = setIsoData(this.context); private subscription: Subscription; private emptyState: AdminSettingsState = { siteRes: this.isoData.site_res, siteConfigHjson: null, - legalInfo: null, siteConfigRes: { config_hjson: null, }, @@ -75,8 +71,6 @@ export class AdminSettings extends Component { if (this.isoData.path == this.context.router.route.match.url) { this.state.siteConfigRes = this.isoData.routeData[0]; this.state.siteConfigHjson = this.state.siteConfigRes.config_hjson; - this.state.legalInfo = - this.state.siteRes.site_view.site.legal_information; this.state.banned = this.isoData.routeData[1].banned; this.state.siteConfigLoading = false; this.state.loading = false; @@ -205,7 +199,7 @@ export class AdminSettings extends Component { return (
    {i18n.t("admin_settings")}
    -
    +
    -
    - -
    -