export default function useTheme()

in projects/deliberation_at_scale/packages/frontend/hooks/useTheme.ts [7:30]


export default function useTheme(): ThemeColors {
    const pathname = usePathname();

    const inferredBaseColor = useMemo(() => {

        // TODO: better way to do this? Bit harder due to translations in URL
        if (pathname?.includes('/login') || pathname?.includes('/register')) {
            return AUTHENTICATE_ROOM_BASE_COLOR;
        }

        if (pathname?.includes('/lobby') || pathname?.includes('/evaluate') || pathname?.includes('/profile')) {
            return DEFAULT_ROOM_BASE_COLOR;
        }

        if (pathname?.includes('/room')) {
            return DELIBERATION_ROOM_BASE_COLOR;
        }

        // home page
        return DELIBERATION_ROOM_BASE_COLOR;
    }, [pathname]);

    return inferredBaseColor;
}