Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support no_footer option #1511

Merged
merged 1 commit into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions frontend/apps/remark42/app/components/root/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions frontend/apps/remark42/app/typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type RemarkConfig = {
max_last_comments?: number;
__colors__?: Record<string, string>;
simple_view?: boolean;
no_footer?: boolean;
};

declare global {
Expand Down
4 changes: 3 additions & 1 deletion site/src/docs/configuration/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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>
```
Expand Down