-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pagination component and logic (#3992)
* feat: add pagination component and logic * feat: add functionality to close feature tour on clicking overlay * refactor: move ProgressIndicator into components * fix: fix failing stories due to implementation of pagination component * fix: refactor code as per comments Co-authored-by: Siddarth Nandanahosur Suresh <[email protected]>
- Loading branch information
1 parent
bf6a233
commit 6ee7026
Showing
6 changed files
with
109 additions
and
43 deletions.
There are no files selected for viewing
File renamed without changes.
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
21 changes: 21 additions & 0 deletions
21
frontend/src/features/admin-form/create/featureTour/FeatureTourContext.tsx
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,21 @@ | ||
import { createContext, useContext } from 'react' | ||
|
||
type FeatureTourContextProps = { | ||
paginationCallback: (indicatorIdx: number) => void | ||
} | ||
|
||
export const FeatureTourContext = createContext< | ||
FeatureTourContextProps | undefined | ||
>(undefined) | ||
|
||
export const useFeatureTourContext = () => { | ||
const context = useContext(FeatureTourContext) | ||
|
||
if (context === undefined) { | ||
throw new Error( | ||
`useFeatureTourContext must be used within a FeatureTourContextProvider`, | ||
) | ||
} | ||
|
||
return context | ||
} |
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