Replace Link with @holllo/gram's PrivacyLink.

This commit is contained in:
Bauke 2022-03-17 14:11:06 +01:00
parent 5c9d6668b3
commit c25e390f68
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
4 changed files with 9 additions and 30 deletions

View File

@ -1,4 +1,3 @@
export * from './link.js';
export * from './page-footer.js';
export * from './page-header.js';
export * from './page-main.js';

View File

@ -1,20 +0,0 @@
import {html} from 'htm/preact';
import {Component} from 'preact';
type Props = {
cssClass: string;
text: string;
url: string;
};
export class Link extends Component<Props> {
render() {
const {cssClass, text, url} = this.props;
return html`
<a class=${cssClass} href=${url} target="_blank" rel="noopener">
${text}
</a>
`;
}
}

View File

@ -1,8 +1,8 @@
import {PrivacyLink} from '@holllo/gram';
import {html} from 'htm/preact';
import {Component} from 'preact';
import {Settings} from '../../settings/settings.js';
import {Link} from './link.js';
type Props = {
settings: Settings;
@ -14,14 +14,15 @@ export class PageFooter extends Component<Props> {
const version = settings.manifest.version;
const donateLink = html`
<${Link} text="Donate" url="https://github.com/sponsors/Bauke" />
<${PrivacyLink} href="https://github.com/sponsors/Bauke">Donate<//>
`;
const versionLink = html`
<${Link}
text="v${version}"
url="https://github.com/Holllo/queue/releases/tag/${version}"
/>
<${PrivacyLink}
href="https://github.com/Holllo/queue/releases/tag/${version}"
>
v${version}
<//>
`;
return html`

View File

@ -1,10 +1,9 @@
import {ConfirmButton} from '@holllo/gram';
import {ConfirmButton, PrivacyLink} from '@holllo/gram';
import {Component, html} from 'htm/preact';
import {Settings} from '../../settings/settings.js';
import {updateBadge} from '../../utilities/badge.js';
import {History} from '../../utilities/history.js';
import {Link} from './link.js';
type Props = {
history: History;
@ -132,7 +131,7 @@ function queueItem(props: ItemProps): HtmComponent {
return html`
<li class="q-item">
<p class="title">
<${Link} text=${text ?? url} url=${url} />
<${PrivacyLink} href=${url}>${text ?? url}<//>
</p>
<div class="buttons">${remove}</div>