2025-01-21 20:26:03 +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-16 02:48:46 +02:00
|
|
|
import { useHistory } from '@/base/hooks/useHistory.ts';
|
2025-01-21 20:26:03 +01:00
|
|
|
|
|
|
|
|
export const AppPageHistoryContext = createContext<string[]>([]);
|
|
|
|
|
|
|
|
|
|
export const useAppPageHistoryContext = () => useContext(AppPageHistoryContext);
|
2025-08-16 02:14:49 +02:00
|
|
|
|
|
|
|
|
export const AppPageHistoryContextProvider = ({ children }: { children: React.ReactNode }) => {
|
|
|
|
|
const history = useHistory();
|
|
|
|
|
|
|
|
|
|
return <AppPageHistoryContext.Provider value={history}>{children}</AppPageHistoryContext.Provider>;
|
|
|
|
|
};
|