diff --git a/.eslintrc b/.eslintrc index 9e1b57f9a..39a03d571 100644 --- a/.eslintrc +++ b/.eslintrc @@ -26,6 +26,9 @@ "es6": true, "jest": true }, + "globals": { + "__APP_VERSION__": true + }, "rules": { "no-tabs": 0, "keyword-spacing": 0, diff --git a/src/webui/src/components/Footer/footer.scss b/src/webui/src/components/Footer/footer.scss new file mode 100644 index 000000000..e6283e550 --- /dev/null +++ b/src/webui/src/components/Footer/footer.scss @@ -0,0 +1,41 @@ +@import '../../styles/variable'; + +.wrap { + margin-top: auto; + border-top: 1px solid $border-color; + background: #f9f9f9; +} +footer.footer { + display: flex; + margin-top: 0; + padding: 20px 0; + font-size: 14px; + line-height: 18px; + height: 18px; + color: #999; + + span { + display: inline-block; + height: 18px; + vertical-align: middle; + } + + :global { + .emoji { + width: 18px; + height: 18px; + } + [data-type="flags"] .emoji { + margin-left: 8px; + } + } + + .right { + margin-left: auto; + } + .logo { + vertical-align: top; + height: 18px; + width: 20px; + } +} diff --git a/src/webui/src/components/Footer/index.js b/src/webui/src/components/Footer/index.js new file mode 100644 index 000000000..cb07b1660 --- /dev/null +++ b/src/webui/src/components/Footer/index.js @@ -0,0 +1,44 @@ +import React from 'react'; + +import classes from './footer.scss'; +import logo from './logo.svg'; + +export default class Footer extends React.Component { + componentDidMount() { + // Scripts inserted at top of `template/index.html` + if (typeof window.twemoji === 'object' && typeof window.twemoji.parse === 'function') { + window.twemoji.parse(document.getElementById('global-footer'), { + // JSDeliver is the fattest open source cdn in all region, see https://www.jsdelivr.com/network + base: 'https://cdn.jsdelivr.net/npm/twemoji@2.5.0/2/', + ext: '.svg', + size: 'svg' + }); + } + } + + render() { + return ( +