aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynithDev <61880709+LynithDev@users.noreply.github.com>2023-12-26 16:31:57 +0100
committerLynithDev <61880709+LynithDev@users.noreply.github.com>2023-12-26 16:31:57 +0100
commit6dbef7946abd350bbfb5cfe21d5f6c1b5e969011 (patch)
tree4c4ed69c5dee494b274c49bf985ff33ad5e79701
parent2df2871c9a5881f53c17d37d05fe409b11bb19a6 (diff)
downloadNexus-6dbef7946abd350bbfb5cfe21d5f6c1b5e969011.tar.gz
Nexus-6dbef7946abd350bbfb5cfe21d5f6c1b5e969011.tar.bz2
Nexus-6dbef7946abd350bbfb5cfe21d5f6c1b5e969011.zip
Update Icon Types + fix type issues in oneconfig page
-rw-r--r--apps/website/src/components/icons/Icon.astro20
-rw-r--r--apps/website/src/components/logos/Logo.astro2
-rw-r--r--apps/website/src/pages/projects/oneconfig.astro4
3 files changed, 21 insertions, 5 deletions
diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro
index 693948d..b9a9b34 100644
--- a/apps/website/src/components/icons/Icon.astro
+++ b/apps/website/src/components/icons/Icon.astro
@@ -2,7 +2,23 @@
import type { HTMLAttributes } from 'astro/types';
import { parse } from 'node-html-parser';
-export type Icons = 'chevron-down' | 'download' | 'book-open';
+type _ModIcons =
+ | 'chatting'
+ | 'polysprint'
+ | 'vanillahud'
+ | 'overflowanimations'
+ | 'crashpatch'
+ | 'polytime'
+ | 'polyweather'
+ | 'keystrokes';
+export type ModIcons = _ModIcons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411
+type _Icons =
+ | 'chevron-down'
+ | 'download'
+ | 'book-open'
+ | 'link-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
@@ -10,7 +26,7 @@ interface Props extends HTMLAttributes<'svg'> {
}
async function getSVG(name: string) {
- const file = await import(`./impl/${name}.svg?raw` /* @vite-ignore */);
+ const file = await import(/* @vite-ignore */ `./impl/${name}.svg?raw`);
if (!file)
throw new Error(`${name} not found`);
diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro
index 52bfe34..c2333e1 100644
--- a/apps/website/src/components/logos/Logo.astro
+++ b/apps/website/src/components/logos/Logo.astro
@@ -19,7 +19,7 @@ try {
if (logo === undefined)
return;
const dir = '../../../public/media';
- svg = (await import(`${dir}/${logo.replaceAll('.', '/')}.svg?raw` /* @vite-ignore */)).default;
+ svg = (await import(/* @vite-ignore */ `${dir}/${logo.replaceAll('.', '/')}.svg?raw`)).default;
if (svg === undefined)
return;
diff --git a/apps/website/src/pages/projects/oneconfig.astro b/apps/website/src/pages/projects/oneconfig.astro
index 22fe171..faa8a98 100644
--- a/apps/website/src/pages/projects/oneconfig.astro
+++ b/apps/website/src/pages/projects/oneconfig.astro
@@ -126,7 +126,7 @@ import { Code } from 'astro:components';
</div>
</Section>
<!-- TODO: add more 3rd party mods, like DSM PSS and Neu maybe -->
- <Slider wrapperClass="-mb-40 pb-4" childrenNum="8">
+ <Slider wrapperClass="-mb-40 pb-4" childrenNum={8}>
<Card text="Chatting" icon="chatting"/>
<Card text="PolySprint" icon="polysprint"/>
<Card text="VanillaHUD" icon="vanillahud"/>
@@ -136,7 +136,7 @@ import { Code } from 'astro:components';
<Card text="PolyWeather" icon="polyweather"/>
<Card text="Keystrokes" icon="keystrokes"/>
</Slider>
- <Slider dir="right" wrapperClass="pb-10" childrenNum="8">
+ <Slider dir="right" wrapperClass="pb-10" childrenNum={8}>
<Card text="Chatting" icon="chatting"/>
<Card text="PolySprint" icon="polysprint"/>
<Card text="VanillaHUD" icon="vanillahud"/>