diff --git a/packages/keychain/.storybook/preview.tsx b/packages/keychain/.storybook/preview.tsx index 2f8c020db..95085f706 100644 --- a/packages/keychain/.storybook/preview.tsx +++ b/packages/keychain/.storybook/preview.tsx @@ -162,7 +162,7 @@ export function ControllerThemeProvider({ children, theme = defaultTheme, }: PropsWithChildren<{ theme?: ControllerTheme }>) { - useThemeEffect({ theme, assetUrl: "" }); + useThemeEffect({ theme }); const chakraTheme = useChakraTheme(theme); return ( diff --git a/packages/keychain/src/components/Provider/theme.tsx b/packages/keychain/src/components/Provider/theme.tsx index bb1272ffe..d821f00d8 100644 --- a/packages/keychain/src/components/Provider/theme.tsx +++ b/packages/keychain/src/components/Provider/theme.tsx @@ -9,7 +9,7 @@ import { PropsWithChildren, useEffect, useMemo } from "react"; export function ControllerThemeProvider({ children }: PropsWithChildren) { const { theme } = useConnection(); - useThemeEffect({ theme, assetUrl: "" }); + useThemeEffect({ theme }); const chakraTheme = useChakraTheme(theme); return ( diff --git a/packages/profile/.env.development b/packages/profile/.env.development index 6465bd4b8..c28d3c8d0 100644 --- a/packages/profile/.env.development +++ b/packages/profile/.env.development @@ -1,5 +1,4 @@ VITE_CARTRIDGE_API_URL="https://api.cartridge.gg" -VITE_KEYCHAIN_URL="http://localhost:3001" VITE_RPC_SEPOLIA="https://api.cartridge.gg/x/starknet/sepolia" VITE_POSTHOG_KEY=phc_UWaJajNQ00PjHhveZ81SJ2zVtBicKrzewdZHGiyavQQ VITE_POSTHOG_HOST=https://profile.cartridge.gg/ingest diff --git a/packages/profile/.env.production b/packages/profile/.env.production index 292a30d28..c28d3c8d0 100644 --- a/packages/profile/.env.production +++ b/packages/profile/.env.production @@ -1,5 +1,4 @@ VITE_CARTRIDGE_API_URL="https://api.cartridge.gg" -VITE_KEYCHAIN_URL="https://x.cartridge.gg" VITE_RPC_SEPOLIA="https://api.cartridge.gg/x/starknet/sepolia" VITE_POSTHOG_KEY=phc_UWaJajNQ00PjHhveZ81SJ2zVtBicKrzewdZHGiyavQQ VITE_POSTHOG_HOST=https://profile.cartridge.gg/ingest diff --git a/packages/profile/src/components/context/theme.tsx b/packages/profile/src/components/context/theme.tsx index a8a750ef8..01eb6e9d3 100644 --- a/packages/profile/src/components/context/theme.tsx +++ b/packages/profile/src/components/context/theme.tsx @@ -83,7 +83,7 @@ export function ThemeProvider({ setTheme(JSON.parse(val)); }, [themeParam, origin]); - useThemeEffect({ theme, assetUrl: import.meta.env.VITE_KEYCHAIN_URL }); + useThemeEffect({ theme }); const value = { colorScheme, diff --git a/packages/ui-next/src/hooks.ts b/packages/ui-next/src/hooks.ts index f0e2b5415..a65243c07 100644 --- a/packages/ui-next/src/hooks.ts +++ b/packages/ui-next/src/hooks.ts @@ -1,13 +1,7 @@ import { useEffect } from "react"; import { hexToHsl } from "@cartridge/utils"; -export function useThemeEffect({ - theme, - assetUrl, -}: { - theme: ControllerTheme; - assetUrl: string; -}) { +export function useThemeEffect({ theme }: { theme: ControllerTheme }) { useEffect(() => { if (!theme) return; @@ -17,12 +11,12 @@ export function useThemeEffect({ document.documentElement.style.setProperty( "--theme-icon-url", - `url("${assetUrl}${theme.icon}")`, + `url("${theme.icon}")`, ); const coverUrl = typeof theme.cover === "string" - ? `url("${assetUrl}${theme.cover}")` - : `url("${assetUrl}${theme.cover[appliedColorMode]}")`; + ? `url("${theme.cover}")` + : `url("${theme.cover[appliedColorMode]}")`; document.documentElement.style.setProperty("--theme-cover-url", coverUrl); if (!theme.colors) return; @@ -45,7 +39,7 @@ export function useThemeEffect({ hexToHsl(val), ); } - }, [theme, assetUrl]); + }, [theme]); } // dup of @cartridge/controller/types