Clean and re-organize post table refactoring (#1000)
* Clean and re-organize post table refactoring * Fix tests
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { currentPageLocationState } from '../states/currentPageLocationState';
|
||||
|
||||
export function useIsPageLoading() {
|
||||
const currentLocation = useLocation().pathname;
|
||||
|
||||
const currentPageLocation = useRecoilValue(currentPageLocationState);
|
||||
|
||||
return currentLocation !== currentPageLocation;
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const currentPageLocationState = atom<string>({
|
||||
key: 'currentPageLocationState',
|
||||
default: '',
|
||||
});
|
||||
Reference in New Issue
Block a user