From aa466b3277b8933bab8d4ee4e3759887dd45d87d Mon Sep 17 00:00:00 2001 From: Fascinated Date: Wed, 12 Jul 2023 11:11:08 +0100 Subject: [PATCH] update config --- README.md | 14 ++++---------- config.json | 12 +++--------- src/app/page.tsx | 4 +++- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 2dfdba0..fd169dc 100644 --- a/README.md +++ b/README.md @@ -93,25 +93,19 @@ simple-links | Type error: Property 'theme' does not exist on type '{ name: stri "title": "Git", // The shown title of the button "url": "https://git.fascinated.cc", // Where the button goes to when clicked "icon": "fab fa-github", // The icon of the button (can be removed to show no icon) - "color": { - // The color of the icon (tailwindcss colors) - "normal": "bg-green-700" - } + // The color of the icon (tailwindcss colors) + "color": "bg-green-700" }, { "title": "Twitch", "url": "https://twitch.tv/fascinated_", "icon": "fab fa-twitch", - "color": { - "normal": "bg-[#6441a5]" - } + "color": "bg-[#6441a5]" }, { "title": "Documentation", "url": "https://docs.fascinated.cc", - "color": { - "normal": "bg-neutral-700" - } + "color": "bg-neutral-700" } ], // Icon only links diff --git a/config.json b/config.json index 948c4f2..75a682c 100644 --- a/config.json +++ b/config.json @@ -35,24 +35,18 @@ "title": "Git", "url": "https://git.fascinated.cc", "icon": "fab fa-git-alt", - "color": { - "normal": "bg-green-700" - } + "color": "bg-green-700" }, { "title": "Twitch", "url": "https://twitch.tv/fascinated_", "icon": "fab fa-twitch", - "color": { - "normal": "bg-[#6441a5]" - } + "color": "bg-[#6441a5]" }, { "title": "Documentation", "url": "https://docs.fascinated.cc", - "color": { - "normal": "bg-neutral-700" - } + "color": "bg-neutral-700" } ], "socialLinks": [ diff --git a/src/app/page.tsx b/src/app/page.tsx index 1e7e306..aad1586 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -96,6 +96,8 @@ export default function Home() { {links && links.map((link, index) => { const icons: any = link.icon?.split(" ") ?? []; + const legacyColor: any = link.color; // Here so old configs don't break + const color = link.color || legacyColor.normal; return ( {link.icon && }

{link.title}