2021-12-30 22:40:57 +00:00
|
|
|
import {Component, html} from 'htm/preact';
|
|
|
|
import ExternalAnchor from './external-anchor.js';
|
|
|
|
|
2022-01-16 12:30:41 +00:00
|
|
|
type Props = {
|
|
|
|
page: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default class SharedFooter extends Component<Props> {
|
2021-12-30 22:40:57 +00:00
|
|
|
render() {
|
2022-01-16 12:30:41 +00:00
|
|
|
const {page} = this.props;
|
|
|
|
|
|
|
|
const homeLink =
|
|
|
|
page === 'home' || page === 'not-found'
|
|
|
|
? undefined
|
|
|
|
: html`<a href="/">Home</a>${' '}`;
|
|
|
|
|
|
|
|
const settingsLink =
|
|
|
|
page === 'settings'
|
|
|
|
? undefined
|
|
|
|
: html`<a href="/settings">Settings</a>${' '}`;
|
|
|
|
|
2022-09-29 14:53:00 +00:00
|
|
|
const giteaUrl = 'https://git.bauke.xyz/Bauke/href-plus';
|
2022-01-06 20:12:20 +00:00
|
|
|
const versionText = `v${hrefPlusVersion}/${hrefPlusCommitHash}`;
|
2022-09-29 14:53:00 +00:00
|
|
|
const versionUrl = `${giteaUrl}/src/commit/${hrefPlusCommitHash}`;
|
2022-01-02 20:36:00 +00:00
|
|
|
|
2021-12-30 22:40:57 +00:00
|
|
|
return html`
|
|
|
|
<footer class="shared-footer">
|
2022-01-16 12:30:41 +00:00
|
|
|
${homeLink}${settingsLink}
|
2022-09-29 14:53:00 +00:00
|
|
|
<${ExternalAnchor} text="Gitea" url=${giteaUrl} />
|
2022-01-02 20:36:00 +00:00
|
|
|
${' '}
|
|
|
|
<${ExternalAnchor} text=${versionText} url=${versionUrl} />
|
2021-12-30 22:40:57 +00:00
|
|
|
</footer>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|