-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added workshop settings save after leaving
- Loading branch information
1 parent
c2b06ea
commit 000b7e4
Showing
7 changed files
with
145 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use client'; | ||
|
||
import { useEffect } from 'react'; | ||
import { usePathname } from 'next/navigation'; | ||
|
||
const WorkshopCacheListener = (): null => { | ||
const pathname = usePathname(); | ||
|
||
useEffect(() => { | ||
if (!pathname.startsWith('/workshop')) { | ||
sessionStorage.removeItem('workshopState'); | ||
} | ||
}, [pathname]); | ||
|
||
return null; | ||
}; | ||
|
||
export default WorkshopCacheListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createContext, useContext } from "react"; | ||
|
||
export interface ConfigInterface { | ||
page: number, | ||
take: number, | ||
search?: string, | ||
filters?: string, | ||
sort?: string, | ||
totalCount: number, | ||
scroll?: number | ||
} | ||
|
||
export const ConfigContext = createContext<{ lastConfig: ConfigInterface }>(null); | ||
export const useConfigContext = () => useContext(ConfigContext); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters