diff --git a/src/components/pages/settings/parts/SettingsOAuth/index.tsx b/src/components/pages/settings/parts/SettingsOAuth/index.tsx index ca890efbf..1d4f42ba9 100755 --- a/src/components/pages/settings/parts/SettingsOAuth/index.tsx +++ b/src/components/pages/settings/parts/SettingsOAuth/index.tsx @@ -37,6 +37,8 @@ const names = { function OAuthButton({ provider, linked }: { provider: OAuthProviderType; linked: boolean }) { const t = useMantineTheme(); + console.log(t); + const unlink = async () => { const { error } = await fetchApi('/api/auth/oauth', 'DELETE', { provider, @@ -66,7 +68,7 @@ function OAuthButton({ provider, linked }: { provider: OAuthProviderType; linked leftSection: icons[provider], color: linked ? 'red' : `${provider.toLowerCase()}.0`, style: { - '--z-bol-color': darken(t.colors[provider.toLowerCase()][0], 0.2, t), + '--z-bol-color': darken(t.colors?.[provider.toLowerCase()]?.[0] ?? '', 0.2, t), }, className: !linked ? styles.button : undefined, }; diff --git a/themes/black_dark.theme.json b/src/lib/theme/builtins/black_dark.theme.json old mode 100755 new mode 100644 similarity index 91% rename from themes/black_dark.theme.json rename to src/lib/theme/builtins/black_dark.theme.json index 196bb459e..0ce828449 --- a/themes/black_dark.theme.json +++ b/src/lib/theme/builtins/black_dark.theme.json @@ -1,5 +1,6 @@ { "name": "Black Dark", + "id": "builtin:black_dark", "colorScheme": "dark", "colors": { "dark": [ diff --git a/src/lib/theme/builtins/catppuccin_frappe.theme.json b/src/lib/theme/builtins/catppuccin_frappe.theme.json new file mode 100644 index 000000000..21b5bbc56 --- /dev/null +++ b/src/lib/theme/builtins/catppuccin_frappe.theme.json @@ -0,0 +1,33 @@ +{ + "name": "Catppuccin Frappé", + "id": "builtin:cat_frappe", + "colorScheme": "dark", + "colors": { + "blue": [ + "#FFFFFF", + "#b8caf4", + "#a2baf1", + "#7599ea", + "#5f89e7", + "#8c99ee", + "#8ca1ee", + "#8cb2ee", + "#8cbaee", + "#8caaee" + ], + "dark": [ + "#c6d0f5", + "#949cbb", + "#838ba7", + "#737994", + "#626880", + "#51576d", + "#414559", + "#303446", + "#292c3c", + "#232634" + ] + }, + "primaryColor": "blue", + "mainBackgroundColor": "var(--mantine-color-dark-9)" +} diff --git a/themes/catppuccin_latte.theme.json b/src/lib/theme/builtins/catppuccin_latte.theme.json similarity index 94% rename from themes/catppuccin_latte.theme.json rename to src/lib/theme/builtins/catppuccin_latte.theme.json index a38906f9f..a93b1b7bb 100644 --- a/themes/catppuccin_latte.theme.json +++ b/src/lib/theme/builtins/catppuccin_latte.theme.json @@ -1,5 +1,6 @@ { "name": "Catppuccin Latte", + "id": "builtin:cat_latte", "colorScheme": "light", "colors": { "blue": [ diff --git a/src/lib/theme/builtins/catppuccin_macchiato.theme.json b/src/lib/theme/builtins/catppuccin_macchiato.theme.json new file mode 100644 index 000000000..3a8f167da --- /dev/null +++ b/src/lib/theme/builtins/catppuccin_macchiato.theme.json @@ -0,0 +1,33 @@ +{ + "name": "Catppuccin Macchiato", + "id": "builtin:cat_macchiato", + "colorScheme": "dark", + "colors": { + "blue": [ + "#FFFFFF", + "#a1bdf6", + "#729cf1", + "#5b8cef", + "#899bf4", + "#89a4f4", + "#89acf4", + "#89b5f4", + "#89bef4", + "#8aadf4" + ], + "dark": [ + "#cad3f5", + "#8087a2", + "#8087a2", + "#6e738d", + "#5b6078", + "#494d64", + "#363a4f", + "#24273a", + "#1e2030", + "#181926" + ] + }, + "primaryColor": "blue", + "mainBackgroundColor": "var(--mantine-color-dark-9)" +} diff --git a/themes/catppuccin_mocha.theme.json b/src/lib/theme/builtins/catppuccin_mocha.theme.json similarity index 94% rename from themes/catppuccin_mocha.theme.json rename to src/lib/theme/builtins/catppuccin_mocha.theme.json index b39dfe36b..11c4f9937 100644 --- a/themes/catppuccin_mocha.theme.json +++ b/src/lib/theme/builtins/catppuccin_mocha.theme.json @@ -1,5 +1,6 @@ { "name": "Catppuccin Mocha", + "id": "builtin:cat_mocha", "colorScheme": "dark", "colors": { "blue": [ diff --git a/themes/dark_blue.theme.json b/src/lib/theme/builtins/dark_blue.theme.json old mode 100755 new mode 100644 similarity index 95% rename from themes/dark_blue.theme.json rename to src/lib/theme/builtins/dark_blue.theme.json index 99f4ae074..bb59c19d8 --- a/themes/dark_blue.theme.json +++ b/src/lib/theme/builtins/dark_blue.theme.json @@ -1,5 +1,6 @@ { "name": "Dark Blue", + "id": "builtin:dark_blue", "colorScheme": "dark", "colors": { "blue": [ diff --git a/themes/light_blue.theme.json b/src/lib/theme/builtins/light_blue.theme.json old mode 100755 new mode 100644 similarity index 92% rename from themes/light_blue.theme.json rename to src/lib/theme/builtins/light_blue.theme.json index 196f79a3f..d9fb12735 --- a/themes/light_blue.theme.json +++ b/src/lib/theme/builtins/light_blue.theme.json @@ -1,5 +1,6 @@ { "name": "Light Blue", + "id": "builtin:light_blue", "colorScheme": "light", "colors": { "blue": [ diff --git a/src/lib/theme/file.ts b/src/lib/theme/file.ts index 6f76e8086..932991b01 100755 --- a/src/lib/theme/file.ts +++ b/src/lib/theme/file.ts @@ -5,12 +5,22 @@ import { exists } from '../fs'; import dark_gray from './builtins/dark_gray.theme.json'; import light_gray from './builtins/light_gray.theme.json'; +import black_dark from './builtins/black_dark.theme.json'; + +import light_blue from './builtins/light_blue.theme.json'; +import dark_blue from './builtins/dark_blue.theme.json'; + +import cat_frappe from './builtins/catppuccin_frappe.theme.json'; +import cat_latte from './builtins/catppuccin_latte.theme.json'; +import cat_macchiato from './builtins/catppuccin_macchiato.theme.json'; +import cat_mocha from './builtins/catppuccin_mocha.theme.json'; + import { log } from '../logger'; const THEMES_DIR = './themes'; const logger = log('theme'); -export async function readThemes(includeBuiltins: boolean = true): Promise { +export async function readThemes(): Promise { const themes = await readThemesDir(); const parsedThemes = await parseThemes(themes); @@ -25,19 +35,22 @@ export async function readThemes(includeBuiltins: boolean = true): Promise t.id), - }); + console.log(parsedThemes); return parsedThemes; } @@ -66,7 +79,7 @@ export async function parseThemes(themes: string[]): Promise { return parsedThemes; } -export async function handleOverrideColors(theme: ZiplineTheme) { +export function handleOverrideColors(theme: ZiplineTheme) { return { ...theme, colors: { diff --git a/themes/catppuccin_frappe.theme.json b/themes/catppuccin_frappe.theme.json deleted file mode 100644 index e34eb8dac..000000000 --- a/themes/catppuccin_frappe.theme.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Catppuccin Frappé", - "colorScheme": "dark", - "colors": { - "blue": [ - "#FFFFFF", - "#b8caf4", - "#a2baf1", - "#7599ea", - "#5f89e7", - "#8c99ee", - "#8ca1ee", - "#8cb2ee", - "#8cbaee", - "#8caaee" - ], - "dark": [ - "#c6d0f5", - "#949cbb", - "#838ba7", - "#737994", - "#626880", - "#51576d", - "#414559", - "#303446", - "#292c3c", - "#232634" - ] - }, - "primaryColor": "blue", - "mainBackgroundColor": "var(--mantine-color-dark-9)" - } diff --git a/themes/catppuccin_macchiato.theme.json b/themes/catppuccin_macchiato.theme.json deleted file mode 100644 index f0226f378..000000000 --- a/themes/catppuccin_macchiato.theme.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Catppuccin Macchiato", - "colorScheme": "dark", - "colors": { - "blue": [ - "#FFFFFF", - "#a1bdf6", - "#729cf1", - "#5b8cef", - "#899bf4", - "#89a4f4", - "#89acf4", - "#89b5f4", - "#89bef4", - "#8aadf4" - ], - "dark": [ - "#cad3f5", - "#8087a2", - "#8087a2", - "#6e738d", - "#5b6078", - "#494d64", - "#363a4f", - "#24273a", - "#1e2030", - "#181926" - ] - }, - "primaryColor": "blue", - "mainBackgroundColor": "var(--mantine-color-dark-9)" - }