[ESLint] Prefer named exports (#427)
This commit is contained in:
@@ -11,17 +11,17 @@ import React, { useMemo } from 'react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import { QueryParamProvider } from 'use-query-params';
|
||||
import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
|
||||
import createTheme from '@/theme';
|
||||
import useLocalStorage from '@/util/useLocalStorage';
|
||||
import DarkTheme from '@/components/context/DarkTheme';
|
||||
import NavBarContextProvider from '@/components/navbar/NavBarContextProvider';
|
||||
import LibraryOptionsContextProvider from '@/components/library/LibraryOptionsProvider';
|
||||
import { createTheme } from '@/theme';
|
||||
import { useLocalStorage } from '@/util/useLocalStorage';
|
||||
import { DarkTheme } from '@/components/context/DarkTheme';
|
||||
import { NavBarContextProvider } from '@/components/navbar/NavBarContextProvider';
|
||||
import { LibraryOptionsContextProvider } from '@/components/library/LibraryOptionsProvider';
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const AppContext: React.FC<Props> = ({ children }) => {
|
||||
export const AppContext: React.FC<Props> = ({ children }) => {
|
||||
const [darkTheme, setDarkTheme] = useLocalStorage<boolean>('darkTheme', true);
|
||||
|
||||
const darkThemeContext = useMemo(
|
||||
@@ -50,5 +50,3 @@ const AppContext: React.FC<Props> = ({ children }) => {
|
||||
</Router>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppContext;
|
||||
|
||||
@@ -13,9 +13,7 @@ type ContextType = {
|
||||
setDarkTheme: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
};
|
||||
|
||||
const DarkTheme = React.createContext<ContextType>({
|
||||
export const DarkTheme = React.createContext<ContextType>({
|
||||
darkTheme: true,
|
||||
setDarkTheme: (): void => {},
|
||||
});
|
||||
|
||||
export default DarkTheme;
|
||||
|
||||
@@ -34,13 +34,11 @@ export const DefaultLibraryOptions: LibraryOptions = {
|
||||
showTabSize: false,
|
||||
};
|
||||
|
||||
const LibraryOptionsContext = React.createContext<ContextType>({
|
||||
export const LibraryOptionsContext = React.createContext<ContextType>({
|
||||
options: DefaultLibraryOptions,
|
||||
setOptions: () => {},
|
||||
});
|
||||
|
||||
export default LibraryOptionsContext;
|
||||
|
||||
export function useLibraryOptionsContext() {
|
||||
return useContext(LibraryOptionsContext);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ type ContextType = {
|
||||
setOverride: React.Dispatch<React.SetStateAction<INavbarOverride>>;
|
||||
};
|
||||
|
||||
const NavBarContext = React.createContext<ContextType>({
|
||||
export const NavBarContext = React.createContext<ContextType>({
|
||||
defaultBackTo: undefined,
|
||||
setDefaultBackTo: (): void => {},
|
||||
title: 'Tachidesk',
|
||||
@@ -38,8 +38,6 @@ const NavBarContext = React.createContext<ContextType>({
|
||||
setOverride: (): void => {},
|
||||
});
|
||||
|
||||
export default NavBarContext;
|
||||
|
||||
export const useNavBarContext = () => useContext(NavBarContext);
|
||||
|
||||
export const useSetDefaultBackTo = (value: string) => {
|
||||
|
||||
Reference in New Issue
Block a user