From c25e390f68cdfd00ae9df37f6b4b5ff935704924 Mon Sep 17 00:00:00 2001 From: Bauke Date: Thu, 17 Mar 2022 14:11:06 +0100 Subject: [PATCH] Replace Link with @holllo/gram's PrivacyLink. --- source/options/components/components.ts | 1 - source/options/components/link.ts | 20 -------------------- source/options/components/page-footer.ts | 13 +++++++------ source/options/components/page-main.ts | 5 ++--- 4 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 source/options/components/link.ts diff --git a/source/options/components/components.ts b/source/options/components/components.ts index 7d40558..470f4e3 100644 --- a/source/options/components/components.ts +++ b/source/options/components/components.ts @@ -1,4 +1,3 @@ -export * from './link.js'; export * from './page-footer.js'; export * from './page-header.js'; export * from './page-main.js'; diff --git a/source/options/components/link.ts b/source/options/components/link.ts deleted file mode 100644 index 7780f8c..0000000 --- a/source/options/components/link.ts +++ /dev/null @@ -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 { - render() { - const {cssClass, text, url} = this.props; - - return html` - - ${text} - - `; - } -} diff --git a/source/options/components/page-footer.ts b/source/options/components/page-footer.ts index 5a5abee..b4d60da 100644 --- a/source/options/components/page-footer.ts +++ b/source/options/components/page-footer.ts @@ -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 { 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` diff --git a/source/options/components/page-main.ts b/source/options/components/page-main.ts index aef82b6..f44b2f4 100644 --- a/source/options/components/page-main.ts +++ b/source/options/components/page-main.ts @@ -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`
  • - <${Link} text=${text ?? url} url=${url} /> + <${PrivacyLink} href=${url}>${text ?? url}

    ${remove}