From 530634fea254c344684d42fe7a1d5b4020f6a3ab Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:29:16 +0100 Subject: Footer + small tweaks --- apps/website/src/components/icons/Icon.astro | 21 +++++++++++++++++---- apps/website/src/components/icons/impl/discord.svg | 1 + apps/website/src/components/icons/impl/github.svg | 3 +++ apps/website/src/components/icons/impl/youtube.svg | 3 +++ 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 apps/website/src/components/icons/impl/discord.svg create mode 100644 apps/website/src/components/icons/impl/github.svg create mode 100644 apps/website/src/components/icons/impl/youtube.svg (limited to 'apps/website/src/components/icons') diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro index b9a9b34..858b605 100644 --- a/apps/website/src/components/icons/Icon.astro +++ b/apps/website/src/components/icons/Icon.astro @@ -1,6 +1,7 @@ --- import type { HTMLAttributes } from 'astro/types'; import { parse } from 'node-html-parser'; +import Test from "./impl/book-open.svg"; type _ModIcons = | 'chatting' @@ -12,21 +13,32 @@ type _ModIcons = | 'polyweather' | 'keystrokes'; export type ModIcons = _ModIcons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 + +type _External = + | 'discord' + | 'github' + | 'youtube' + | 'twitter'; + +export type External = _External; + type _Icons = | 'chevron-down' | 'download' | 'book-open' | 'link-external' + | External | ModIcons; export type Icons = _Icons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 interface Props extends HTMLAttributes<'svg'> { - icon: Icons + icon: Icons, + path?: string, size?: number | [number, number] } -async function getSVG(name: string) { - const file = await import(/* @vite-ignore */ `./impl/${name}.svg?raw`); +async function getSVG(name: string, path = 'impl') { + const file = await import(`./${path}/${name}.svg?raw`); if (!file) throw new Error(`${name} not found`); @@ -49,6 +61,7 @@ async function getSVG(name: string) { const { icon, size, + path = 'impl', ...attributes } = Astro.props as Props; @@ -73,7 +86,7 @@ try { }; }; - const { attributes: baseAttributes, innerHTML } = await getSVG(icon); + const { attributes: baseAttributes, innerHTML } = await getSVG(icon, path); svgAttributes = { ...baseAttributes, ...attributes, diff --git a/apps/website/src/components/icons/impl/discord.svg b/apps/website/src/components/icons/impl/discord.svg new file mode 100644 index 0000000..7fcddad --- /dev/null +++ b/apps/website/src/components/icons/impl/discord.svg @@ -0,0 +1 @@ + diff --git a/apps/website/src/components/icons/impl/github.svg b/apps/website/src/components/icons/impl/github.svg new file mode 100644 index 0000000..cb3681d --- /dev/null +++ b/apps/website/src/components/icons/impl/github.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/website/src/components/icons/impl/youtube.svg b/apps/website/src/components/icons/impl/youtube.svg new file mode 100644 index 0000000..827dc58 --- /dev/null +++ b/apps/website/src/components/icons/impl/youtube.svg @@ -0,0 +1,3 @@ + + + -- cgit