🎨 Made color switcher change Mantine styles

Moved the color switcher's functions to a context provider and made Mantine's styles derived off of that context.
This commit is contained in:
Aimsucks
2022-06-08 14:58:32 +00:00
parent b26ab50c8d
commit 845d6a3d87
9 changed files with 75 additions and 53 deletions

View File

@@ -1,10 +1,12 @@
import { Group, Image, Text } from '@mantine/core';
import { NextLink } from '@mantine/next';
import * as React from 'react';
import { useColorTheme } from '../../tools/color';
import { useConfig } from '../../tools/state';
export function Logo({ style }: any) {
const { config } = useConfig();
const { primaryColor, secondaryColor } = useColorTheme();
return (
<Group spacing="xs">
@@ -27,8 +29,8 @@ export function Logo({ style }: any) {
weight="bold"
variant="gradient"
gradient={{
from: config.settings.primaryColor || 'red',
to: config.settings.secondaryColor || 'orange',
from: primaryColor,
to: secondaryColor,
deg: 145,
}}
>