Add configurable donate, CLI and DMCA and source links in footer

This commit is contained in:
timvisee 2021-01-27 00:13:56 +01:00
parent 7f3da34318
commit 6960cc75fa
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
11 changed files with 98 additions and 9 deletions

View file

@ -51,6 +51,7 @@ if (process.env.NODE_ENV === 'production') {
window.initialState = {
LIMITS,
DEFAULTS,
WEB_UI,
PREFS,
archive: new Archive([], DEFAULTS.EXPIRE_SECONDS),
capabilities,

View file

@ -13,6 +13,58 @@ class Footer extends Component {
createElement() {
const translate = this.state.translate;
// Add additional links from configuration if available
var links = [];
if (this.state != undefined && this.state.WEB_UI != undefined) {
const WEB_UI = this.state.WEB_UI;
if (WEB_UI.FOOTER_DONATE_URL != '') {
links.push(html`
<li class="m-2">
<a href="${WEB_UI.FOOTER_DONATE_URL}" target="_blank">
${translate('footerLinkDonate')}
</a>
</li>
`);
}
if (WEB_UI.FOOTER_CLI_URL != '') {
links.push(html`
<li class="m-2">
<a href="${WEB_UI.FOOTER_CLI_URL}" target="_blank">
${translate('footerLinkCli')}
</a>
</li>
`);
}
if (WEB_UI.FOOTER_DMCA_URL != '') {
links.push(html`
<li class="m-2">
<a href="${WEB_UI.FOOTER_DMCA_URL}" target="_blank">
${translate('footerLinkDmca')}
</a>
</li>
`);
}
if (WEB_UI.FOOTER_SOURCE_URL != '') {
links.push(html`
<li class="m-2">
<a href="${WEB_UI.FOOTER_SOURCE_URL}" target="_blank">
${translate('footerLinkSource')}
</a>
</li>
`);
}
} else {
links.push(html`
<li class="m-2">
<a href="https://gitlab.com/timvisee/send" target="_blank">
${translate('footerLinkSource')}
</a>
</li>
`);
}
return html`
<footer
class="flex flex-col md:flex-row items-start w-full flex-none self-start p-6 md:p-8 font-medium text-xs text-grey-60 dark:text-grey-40 md:items-center justify-between"
@ -21,11 +73,7 @@ class Footer extends Component {
<ul
class="flex flex-col md:flex-row items-start md:items-center md:justify-end"
>
<li class="m-2">
<a href="https://gitlab.com/timvisee/send"
>${translate('footerLinkSource')}</a
>
</li>
${links}
</ul>
</footer>
`;

View file

@ -16,6 +16,7 @@ class Header extends Component {
this.account.render();
return false;
}
createElement() {
const title =
platform() === 'android'