forked from harness/canary
-
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.
commit: refactor: move dialog context to providers directory
This commit reorganizes the dialog-related code by: Moving DialogsProvider from context/ to providers/ directory Updating import paths across components to use the new location 3. Removing unused context files and types Consolidating dialog-related code for better maintainability This is a structural change that improves code organization while maintaining existing functionality.
- Loading branch information
1 parent
1fb8e1b
commit fb05ddf
Showing
10 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/ui/src/views/user-management/components/dialogs/dialogs.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
2 changes: 1 addition & 1 deletion
2
...src/views/user-management/components/dialogs/hooks/useDialogHandlers/useDialogHandlers.ts
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 was deleted.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
packages/ui/src/views/user-management/providers/DialogsProvider/hooks/useDialogs.ts
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,13 @@ | ||
import { useContext } from 'react' | ||
|
||
import { DialogsContext } from '@/views/user-management/providers/DialogsProvider' | ||
|
||
export const useDialogs = () => { | ||
const context = useContext(DialogsContext) | ||
|
||
if (!context) { | ||
throw new Error('useDialogs must be used within DialogsProvider') | ||
} | ||
|
||
return context | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/ui/src/views/user-management/providers/DialogsProvider/index.ts
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,2 @@ | ||
export * from './DialogsProvider' | ||
export * from './hooks/useDialogs' |
File renamed without changes.
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