Rename context types
This commit is contained in:
@@ -10,12 +10,12 @@ import React, { useContext } from 'react';
|
||||
import { DEFAULT_CATEGORY_METADATA } from '@/modules/category/services/CategoryMetadata.ts';
|
||||
import { LibraryOptions } from '@/modules/library/Library.types.ts';
|
||||
|
||||
type ContextType = {
|
||||
type LibraryOptionsContextType = {
|
||||
options: LibraryOptions;
|
||||
setOptions: React.Dispatch<React.SetStateAction<LibraryOptions>>;
|
||||
};
|
||||
|
||||
export const LibraryOptionsContext = React.createContext<ContextType>({
|
||||
export const LibraryOptionsContext = React.createContext<LibraryOptionsContextType>({
|
||||
options: DEFAULT_CATEGORY_METADATA,
|
||||
setOptions: () => {},
|
||||
});
|
||||
|
||||
@@ -10,12 +10,12 @@ import React, { useContext } from 'react';
|
||||
|
||||
import { INavbarOverride } from '@/modules/navigation-bar/NavigationBar.types.ts';
|
||||
|
||||
type ContextType = {
|
||||
type NavbarContextType = {
|
||||
history: string[];
|
||||
|
||||
// AppBar title
|
||||
title: string | React.ReactNode;
|
||||
setTitle: (title: ContextType['title'], browserTitle?: string) => void;
|
||||
setTitle: (title: NavbarContextType['title'], browserTitle?: string) => void;
|
||||
|
||||
appBarHeight: number;
|
||||
setAppBarHeight: React.Dispatch<React.SetStateAction<number>>;
|
||||
@@ -42,7 +42,7 @@ type ContextType = {
|
||||
setBottomBarHeight: React.Dispatch<React.SetStateAction<number>>;
|
||||
};
|
||||
|
||||
export const NavBarContext = React.createContext<ContextType>({
|
||||
export const NavBarContext = React.createContext<NavbarContextType>({
|
||||
history: [],
|
||||
title: 'Suwayomi',
|
||||
setTitle: (): void => {},
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
|
||||
import { createContext, useContext } from 'react';
|
||||
|
||||
type TReaderContext = {
|
||||
type TReaderProgressBarContext = {
|
||||
isMaximized: boolean;
|
||||
setIsMaximized: (visible: boolean) => void;
|
||||
isDragging: boolean;
|
||||
setIsDragging: (isDragging: boolean) => void;
|
||||
};
|
||||
|
||||
export const ReaderProgressBarContext = createContext<TReaderContext>({
|
||||
export const ReaderProgressBarContext = createContext<TReaderProgressBarContext>({
|
||||
isMaximized: false,
|
||||
setIsMaximized: () => undefined,
|
||||
isDragging: false,
|
||||
|
||||
@@ -15,7 +15,7 @@ export enum ThemeMode {
|
||||
LIGHT = 'light',
|
||||
}
|
||||
|
||||
type ContextType = {
|
||||
type ThemeModeContextType = {
|
||||
appTheme: AppThemes;
|
||||
setAppTheme: React.Dispatch<React.SetStateAction<AppThemes>>;
|
||||
themeMode: ThemeMode;
|
||||
@@ -24,7 +24,7 @@ type ContextType = {
|
||||
setPureBlackMode: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
};
|
||||
|
||||
export const ThemeModeContext = React.createContext<ContextType>({
|
||||
export const ThemeModeContext = React.createContext<ThemeModeContextType>({
|
||||
appTheme: 'default',
|
||||
setAppTheme: (): void => {},
|
||||
themeMode: ThemeMode.SYSTEM,
|
||||
|
||||
Reference in New Issue
Block a user