-
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 accept deny modal and created field ids from mfb
- Loading branch information
1 parent
d65f838
commit 23f0581
Showing
8 changed files
with
200 additions
and
54 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
22 changes: 22 additions & 0 deletions
22
frontend/src/features/admin-form/create/builder-and-design/useMagicFormBuilderStore.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,22 @@ | ||
import create from 'zustand' | ||
|
||
export type MagicFormBuilderStore = { | ||
recentlyCreatedFieldIds: Set<string> | ||
setRecentlyCreatedFieldIds: (fieldIds: Set<string>) => void | ||
clearRecentlyCreatedFieldIds: () => void | ||
} | ||
|
||
export const useMagicFormBuilderStore = create<MagicFormBuilderStore>( | ||
(set) => ({ | ||
recentlyCreatedFieldIds: new Set(), | ||
setRecentlyCreatedFieldIds: (fieldIds) => | ||
set({ recentlyCreatedFieldIds: fieldIds }), | ||
clearRecentlyCreatedFieldIds: () => | ||
set({ recentlyCreatedFieldIds: new Set() }), | ||
}), | ||
) | ||
|
||
export const recentlyCreatedFieldIdsSelector = ( | ||
state: MagicFormBuilderStore, | ||
): MagicFormBuilderStore['recentlyCreatedFieldIds'] => | ||
state.recentlyCreatedFieldIds |
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
Oops, something went wrong.