Rename context types

This commit is contained in:
schroda
2024-12-20 21:30:41 +01:00
parent 28d0b470bf
commit 9d37c8bc15
4 changed files with 9 additions and 9 deletions

View File

@@ -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: () => {},
});

View File

@@ -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 => {},

View File

@@ -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,

View File

@@ -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,