From f0186d1aab4edac1a8f555cf78ce1b5652c97603 Mon Sep 17 00:00:00 2001 From: Paul Mineev Date: Sun, 8 Jan 2023 12:59:55 -0500 Subject: [PATCH] fix: fix no footer param --- frontend/apps/remark42/app/common/settings.ts | 1 + .../remark42/app/components/root/root.tsx | 24 ++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/frontend/apps/remark42/app/common/settings.ts b/frontend/apps/remark42/app/common/settings.ts index e274964e..118cd139 100644 --- a/frontend/apps/remark42/app/common/settings.ts +++ b/frontend/apps/remark42/app/common/settings.ts @@ -26,3 +26,4 @@ export const pageTitle = rawParams.page_title; export const url = rawParams.url; export const token = rawParams.token; export const locale = rawParams.locale || 'en'; +export const noFooter = rawParams.no_footer === 'true'; diff --git a/frontend/apps/remark42/app/components/root/root.tsx b/frontend/apps/remark42/app/components/root/root.tsx index 5becc5e6..ef90878b 100644 --- a/frontend/apps/remark42/app/components/root/root.tsx +++ b/frontend/apps/remark42/app/components/root/root.tsx @@ -8,7 +8,7 @@ import clsx from 'clsx'; import 'styles/global.css'; import type { StoreState } from 'store'; import { COMMENT_NODE_CLASSNAME_PREFIX, MAX_SHOWN_ROOT_COMMENTS, THEMES, IS_MOBILE } from 'common/constants'; -import { maxShownComments, url } from 'common/settings'; +import { maxShownComments, noFooter, url } from 'common/settings'; import { fetchUser, @@ -329,12 +329,6 @@ const CopyrightLink = (title: string) => ( ); -const Copyright = () => ( -

- -

-); - /** Root component connected to redux */ export function ConnectedRoot() { const intl = useIntl(); @@ -349,16 +343,18 @@ export function ConnectedRoot() { return () => observer.disconnect(); }, []); - if (!window.remark_config) { - throw new Error('Remark42: Config object is undefined'); - } - - const { no_footer } = window.remark_config; - return (
- {!no_footer && } + {!noFooter && ( +

+ +

+ )}
); }