fangs/source/options/components/page-footer.ts

39 lines
992 B
TypeScript
Raw Normal View History

2022-10-03 16:19:27 +00:00
import {PrivacyLink} from '@holllo/preact-components';
2022-03-14 09:58:47 +00:00
import {html} from 'htm/preact';
import {Component} from 'preact';
import type browser from 'webextension-polyfill';
2022-03-14 09:58:47 +00:00
type Props = {
manifest: browser.Manifest.ManifestBase;
};
export class PageFooter extends Component<Props> {
render() {
const {manifest} = this.props;
const version = manifest.version;
2022-10-03 16:50:52 +00:00
const donateAttributes = {
href: 'https://liberapay.com/Holllo',
};
const donateLink = html`
<${PrivacyLink} attributes="${donateAttributes}">Donate<//>
`;
const versionLinkAttributes = {
2022-09-30 10:24:33 +00:00
href: `https://git.bauke.xyz/Holllo/fangs/releases/tag/${version}`,
};
2022-03-14 09:58:47 +00:00
const versionLink = html`
<${PrivacyLink} attributes=${versionLinkAttributes}>v${version}<//>
2022-03-14 09:58:47 +00:00
`;
return html`
<footer class="page-footer">
2022-10-03 16:50:52 +00:00
<p>
${donateLink} 💖 ${versionLink} © Holllo Free and open-source,
forever.
</p>
2022-03-14 09:58:47 +00:00
</footer>
`;
}
}