Add dedicated store access util functions

Makes it easier to find the specific store slice usage
This commit is contained in:
schroda
2025-09-21 00:50:19 +02:00
parent ed488f76dd
commit 525173e05e
28 changed files with 247 additions and 161 deletions

View File

@@ -23,7 +23,7 @@ import { ReaderBehaviourSettings } from '@/features/reader/settings/behaviour/Re
import { ReaderDefaultLayoutSettings } from '@/features/reader/settings/layout/ReaderDefaultLayoutSettings.tsx';
import { ReaderHotkeysSettings } from '@/features/reader/hotkeys/settings/ReaderHotkeysSettings.tsx';
import { withPropsFrom } from '@/base/hoc/withPropsFrom.tsx';
import { useReaderStore } from '@/features/reader/stores/ReaderStore.ts';
import { useReaderTapZoneStore } from '@/features/reader/stores/ReaderStore.ts';
const BaseReaderSettingsTabs = ({
activeTab,
@@ -45,7 +45,7 @@ const BaseReaderSettingsTabs = ({
}) => {
const { t } = useTranslation();
const isTouchDevice = MediaQuery.useIsTouchDevice();
const setShowPreview = useReaderStore((state) => state.tapZone.setShowPreview);
const setShowPreview = useReaderTapZoneStore((state) => state.tapZone.setShowPreview);
return (
<>

View File

@@ -15,10 +15,10 @@ import { ReaderSettingsTabs } from '@/features/reader/settings/components/Reader
import { ReaderSettingTab } from '@/features/reader/settings/ReaderSettings.constants.tsx';
import { useDisableAllHotkeysWhileMounted } from '@/features/hotkeys/Hotkeys.utils.ts';
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
import { useReaderStore } from '@/features/reader/stores/ReaderStore.ts';
import { useReaderSettingsStore } from '@/features/reader/stores/ReaderStore.ts';
export const ReaderSettings = ({ isOpen, close }: { isOpen: boolean; close: () => void }) => {
const settings = useReaderStore((state) => state.settings);
const settings = useReaderSettingsStore((state) => state.settings);
useDisableAllHotkeysWhileMounted(isOpen);