Support no_footer option

This commit is contained in:
Denis Hananein
2022-10-25 21:42:08 -05:00
committed by Umputun
parent 2bdc05dd47
commit 984fbde540
3 changed files with 17 additions and 8 deletions
@@ -351,22 +351,28 @@ const CopyrightLink = (title: string) => (
</a>
);
const Copyright = () => (
<p className="root__copyright" role="contentinfo">
<FormattedMessage id="root.powered-by" defaultMessage="Powered by <a>Remark42</a>" values={{ a: CopyrightLink }} />
</p>
);
/** Root component connected to redux */
export function ConnectedRoot() {
const intl = useIntl();
const props = useSelector(mapStateToProps);
const actions = useActions(boundActions);
if (!window.remark_config) {
throw new Error('Remark42: Config object is undefined');
}
const { no_footer } = window.remark_config;
return (
<div className={clsx(b('root', {}, { theme: props.theme }), props.theme)}>
<Root {...props} {...actions} intl={intl} />
<p className="root__copyright" role="contentinfo">
<FormattedMessage
id="root.powered-by"
defaultMessage="Powered by <a>Remark42</a>"
values={{ a: CopyrightLink }}
/>
</p>
{!no_footer && <Copyright />}
</div>
);
}
+1
View File
@@ -13,6 +13,7 @@ type RemarkConfig = {
max_last_comments?: number;
__colors__?: Record<string, string>;
simple_view?: boolean;
no_footer?: boolean;
};
declare global {
@@ -20,6 +20,7 @@ title: Frontend Configuration
- **`show_email_subscription`**`: boolean` (optional, `true` by default) enables email subscription feature in interface when enable it from backend side, if you set this param in `false` you will get notifications email notifications as admin but your users won't have interface for subscription
- **`show_rss_subscription`**`: boolean` (optional, `true` by default) enables RSS subscription feature in interface
- **`simple_view`**`: boolean` (optional, `false` by default) overrides the parameter from the backend minimized UI with basic info only
- **`no_footer`**`: boolean` (optional, `false` by default) hides footer with signatue and links to remark42
Example with all of the params:
@@ -34,7 +35,8 @@ Example with all of the params:
page_title: 'My custom title for a page',
locale: 'es',
show_email_subscription: false,
simple_view: true
simple_view: true,
no_footer: false
}
</script>
```