Skip to content

Commit

Permalink
feat(client): support footer (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored Oct 6, 2023
1 parent 0efc099 commit 26f6b71
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions deployment/ansible/conf/judgels-client.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ window.conf = {
title: '{{ app_title }}',
description: '{{ app_description }}',
},
{% if app_footer is defined %}
footer: '{{ app_footer }}',
{% endif %}
{% if googleAnalytics_trackingId is defined %}
googleAnalytics: {
trackingId: '{{ googleAnalytics_trackingId }}',
Expand Down
1 change: 1 addition & 0 deletions deployment/ansible/env-example/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ app_name: Judgels
app_slogan: Programming Contest System
app_title: <h1>Welcome to Judgels</h1>
app_description: <h2>This is a programming contest system.</h2>
app_footer: © Ikatan Alumni TOKI

nginx_domain_judgels_client: judgels.com
nginx_domain_judgels_server_api: api.judgels.com
Expand Down
1 change: 1 addition & 0 deletions judgels-client/public/var/conf/judgels-client.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ window.conf = {
description:
'<h2>This is a programming contest system.</h2>',
},
footer: '© Ikatan Alumni TOKI',
};
8 changes: 7 additions & 1 deletion judgels-client/src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import HTMLReactParser from 'html-react-parser';

import { APP_CONFIG } from '../../conf';

import './Footer.scss';

export function Footer() {
const footer = APP_CONFIG.footer || '© Ikatan Alumni TOKI';

return (
<div className="footer">
<hr />
<small className="footer__text">
<div className="float-left">&copy; Ikatan Alumni TOKI</div>
<div className="float-left">{HTMLReactParser(footer)}</div>
<div className="float-right">
Powered by <a href="https://github.com/ia-toki/judgels">Judgels</a>
</div>
Expand Down

0 comments on commit 26f6b71

Please sign in to comment.