Files
suwayomi-material-you-webui/src/features/reader/contexts/ReaderAutoScrollContext.tsx

25 lines
787 B
TypeScript
Raw Normal View History

2024-12-27 00:30:19 +01:00
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { createContext, useContext } from 'react';
2025-08-15 22:02:58 +02:00
import { TReaderAutoScrollContext } from '@/features/reader/types/Reader.types.ts';
2024-12-27 00:30:19 +01:00
export const ReaderAutoScrollContext = createContext<TReaderAutoScrollContext>({
isActive: false,
2024-12-27 03:29:17 +01:00
isPaused: false,
2024-12-27 00:30:19 +01:00
setScrollRef: () => {},
start: () => {},
cancel: () => {},
2024-12-27 03:29:17 +01:00
toggleActive: () => {},
pause: () => {},
resume: () => {},
setDirection: () => {},
2024-12-27 00:30:19 +01:00
});
export const useReaderAutoScrollContext = () => useContext(ReaderAutoScrollContext);