Cleaned up tests and lint errors. Upgraded npm packages.
This commit is contained in:
@@ -1,22 +1,7 @@
|
||||
import { createContext, useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
enum ViewportMode {
|
||||
DESKTOP = "desktop",
|
||||
MOBILE_LANDSCAPE = "mobile-landscape",
|
||||
MOBILE_PORTRAIT = "mobile-portrait",
|
||||
}
|
||||
|
||||
interface MediaQueryContextType {
|
||||
viewportMode: ViewportMode;
|
||||
isDesktop: boolean;
|
||||
isMobileLandscape: boolean;
|
||||
isMobilePortrait: boolean;
|
||||
}
|
||||
|
||||
export const MediaQueryContext = createContext<
|
||||
MediaQueryContextType | undefined
|
||||
>(undefined);
|
||||
import { MediaQueryContext, ViewportMode } from "./context";
|
||||
|
||||
export const MediaQueryProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [viewportMode, setViewportMode] = useState<ViewportMode>(
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
import { createContext, useReducer } from "react";
|
||||
import { useReducer } from "react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import * as colorlib from "colorlib";
|
||||
|
||||
import { colorReducer, createColorActions } from "@/hooks/color";
|
||||
import type { ColorActions } from "@/hooks/color";
|
||||
|
||||
interface SelectedColorContextType {
|
||||
selectedColor: colorlib.Color;
|
||||
selectedColorActions: ColorActions;
|
||||
}
|
||||
|
||||
export const SelectedColorContext = createContext<
|
||||
SelectedColorContextType | undefined
|
||||
>(undefined);
|
||||
import { SelectedColorContext } from "./context";
|
||||
|
||||
export const SelectedColorProvider = ({
|
||||
children,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { createContext } from "react";
|
||||
|
||||
import * as colorlib from "colorlib";
|
||||
|
||||
import type { ColorActions } from "@/hooks/color";
|
||||
|
||||
export enum ViewportMode {
|
||||
DESKTOP = "desktop",
|
||||
MOBILE_LANDSCAPE = "mobile-landscape",
|
||||
MOBILE_PORTRAIT = "mobile-portrait",
|
||||
}
|
||||
|
||||
interface MediaQueryContextType {
|
||||
viewportMode: ViewportMode;
|
||||
isDesktop: boolean;
|
||||
isMobileLandscape: boolean;
|
||||
isMobilePortrait: boolean;
|
||||
}
|
||||
|
||||
export const MediaQueryContext = createContext<
|
||||
MediaQueryContextType | undefined
|
||||
>(undefined);
|
||||
|
||||
interface SelectedColorContextType {
|
||||
selectedColor: colorlib.Color;
|
||||
selectedColorActions: ColorActions;
|
||||
}
|
||||
|
||||
export const SelectedColorContext = createContext<
|
||||
SelectedColorContextType | undefined
|
||||
>(undefined);
|
||||
Reference in New Issue
Block a user