From 60c49f18389ff625177a57277ef8f292a31097bf Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 28 Oct 2023 17:12:58 +0200 Subject: refactor(providers,hooks): rewrite PrismThemeProvider & usePrismTheme * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load --- src/types/app.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/types') diff --git a/src/types/app.ts b/src/types/app.ts index 565fe97..2588a7b 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -2,6 +2,7 @@ import type { NextPage } from 'next'; import type { AppProps as NextAppProps } from 'next/app'; import type { ReactElement, ReactNode } from 'react'; import type { MessageFormatElement } from 'react-intl'; +import type { VALID_THEMES } from '../utils/constants'; export type NextPageWithLayoutOptions = { withExtraPadding?: boolean; @@ -139,3 +140,5 @@ export type Spacing = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'; export type Validator = (value: unknown) => value is T; export type AckeeTrackerValue = 'full' | 'partial'; + +export type Theme = (typeof VALID_THEMES)[number]; -- cgit v1.2.3