2018-10-25 02:07:10 +00:00
|
|
|
const html = require('choo/html');
|
2018-11-12 19:13:31 +00:00
|
|
|
const Component = require('choo/component');
|
2018-10-25 02:07:10 +00:00
|
|
|
|
2018-11-12 19:13:31 +00:00
|
|
|
class Footer extends Component {
|
|
|
|
constructor(name, state) {
|
|
|
|
super(name);
|
|
|
|
this.state = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
update() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
createElement() {
|
|
|
|
const translate = this.state.translate;
|
2021-01-26 23:13:56 +00:00
|
|
|
|
|
|
|
// 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>
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
|
2018-11-12 19:13:31 +00:00
|
|
|
return html`
|
|
|
|
<footer
|
2019-09-09 17:34:55 +00:00
|
|
|
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"
|
2018-11-12 19:13:31 +00:00
|
|
|
>
|
2021-01-27 12:34:26 +00:00
|
|
|
<ul
|
|
|
|
class="flex flex-col md:flex-row items-start md:items-center md:justify-start"
|
|
|
|
>
|
|
|
|
<li class="m-2">${translate('footerText')}</li>
|
|
|
|
</ul>
|
2018-11-12 19:13:31 +00:00
|
|
|
<ul
|
2019-06-14 18:30:43 +00:00
|
|
|
class="flex flex-col md:flex-row items-start md:items-center md:justify-end"
|
2018-11-12 19:13:31 +00:00
|
|
|
>
|
2021-01-26 23:13:56 +00:00
|
|
|
${links}
|
2018-11-12 19:13:31 +00:00
|
|
|
</ul>
|
|
|
|
</footer>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Footer;
|