Add dedicated store access util functions
Makes it easier to find the specific store slice usage
This commit is contained in:
@@ -15,18 +15,18 @@ import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import { ReadingDirection } from '@/features/reader/Reader.types.ts';
|
||||
import { withPropsFrom } from '@/base/hoc/withPropsFrom.tsx';
|
||||
import { NavbarContextType } from '@/features/navigation-bar/NavigationBar.types.ts';
|
||||
import { useReaderStore } from '@/features/reader/stores/ReaderStore.ts';
|
||||
import { useReaderSettingsStore, useReaderTapZoneStore } from '@/features/reader/stores/ReaderStore.ts';
|
||||
|
||||
const CANVAS_ID = 'reader-tap-zone-layout-canvas';
|
||||
|
||||
const BaseTapZoneLayout = ({ readerNavBarWidth }: Pick<NavbarContextType, 'readerNavBarWidth'>) => {
|
||||
const theme = useTheme();
|
||||
const { tapZoneLayout, tapZoneInvertMode, readingDirection } = useReaderStore((state) => ({
|
||||
const { tapZoneLayout, tapZoneInvertMode, readingDirection } = useReaderSettingsStore((state) => ({
|
||||
tapZoneLayout: state.settings.tapZoneLayout.value,
|
||||
tapZoneInvertMode: state.settings.tapZoneInvertMode.value,
|
||||
readingDirection: state.settings.readingDirection.value,
|
||||
}));
|
||||
const showPreview = useReaderStore((state) => state.tapZone.showPreview);
|
||||
const showPreview = useReaderTapZoneStore((state) => state.tapZone.showPreview);
|
||||
|
||||
const [width, setWidth] = useState(0);
|
||||
const [height, setHeight] = useState(0);
|
||||
|
||||
Reference in New Issue
Block a user