adds eslint

This commit is contained in:
geoffsee
2025-06-24 17:29:52 -04:00
committed by Geoff Seemueller
parent 9698fc6f3b
commit 02c3253343
169 changed files with 4896 additions and 4804 deletions

View File

@@ -1,13 +1,9 @@
import {
ChakraProvider,
cookieStorageManagerSSR,
localStorageManager,
} from "@chakra-ui/react";
import { ChakraProvider, cookieStorageManagerSSR, localStorageManager } from '@chakra-ui/react';
export function Chakra({ cookies, children, theme }) {
const colorModeManager =
typeof cookies === "string"
? cookieStorageManagerSSR("color_state", cookies)
typeof cookies === 'string'
? cookieStorageManagerSSR('color_state', cookies)
: localStorageManager;
return (

View File

@@ -1,5 +1,5 @@
import React, { createContext, useContext, useState, useEffect } from "react";
import { useMediaQuery } from "@chakra-ui/react";
import { useMediaQuery } from '@chakra-ui/react';
import React, { createContext, useContext, useState, useEffect } from 'react';
// Create the context to provide mobile state
const MobileContext = createContext(false);
@@ -7,25 +7,20 @@ const MobileContext = createContext(false);
// Create a provider component to wrap your app
export const MobileProvider = ({ children }: { children: React.ReactNode }) => {
const [isMobile, setIsMobile] = useState(false);
const [isFallbackMobile] = useMediaQuery("(max-width: 768px)");
const [isFallbackMobile] = useMediaQuery('(max-width: 768px)');
useEffect(() => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
const mobile =
/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
userAgent.toLowerCase(),
);
const mobile = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
userAgent.toLowerCase(),
);
setIsMobile(mobile);
}, []);
// Provide the combined mobile state globally
const mobileState = isMobile || isFallbackMobile;
return (
<MobileContext.Provider value={mobileState}>
{children}
</MobileContext.Provider>
);
return <MobileContext.Provider value={mobileState}>{children}</MobileContext.Provider>;
};
// Custom hook to use the mobile context in any component