File tree Expand file tree Collapse file tree 6 files changed +13
-4
lines changed
apps/frontend/src/components Expand file tree Collapse file tree 6 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ import { AddEditModal } from '@gitroom/frontend/components/new-launch/add.edit.m
53
53
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog' ;
54
54
import { useVariables } from '@gitroom/react/helpers/variable.context' ;
55
55
import { stripHtmlValidation } from '@gitroom/helpers/utils/strip.html.validation' ;
56
- import { ModalWrapperComponent } from '../new-launch/modal.wrapper.component' ;
57
56
import { newDayjs } from '@gitroom/frontend/components/layout/set.timezone' ;
58
57
59
58
// Extend dayjs with necessary plugins
@@ -464,6 +463,7 @@ export const CalendarColumn: FC<{
464
463
? ExistingDataContextProvider
465
464
: Fragment ;
466
465
modal . openModal ( {
466
+ id : 'add-edit-modal' ,
467
467
closeOnClickOutside : false ,
468
468
removeLayout : true ,
469
469
closeOnEscape : false ,
@@ -553,6 +553,7 @@ export const CalendarColumn: FC<{
553
553
classNames : {
554
554
modal : 'w-[100%] max-w-[1400px] text-textColor' ,
555
555
} ,
556
+ id : 'add-edit-modal' ,
556
557
children : (
557
558
< AddEditModal
558
559
allIntegrations = { integrations . map ( ( p ) => ( {
Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ const FirstStep: FC = (props) => {
158
158
classNames : {
159
159
modal : 'w-[100%] max-w-[1400px] bg-transparent text-textColor' ,
160
160
} ,
161
+ id : 'add-edit-modal' ,
161
162
children : (
162
163
< AddEditModal
163
164
allIntegrations = { integrations . map ( ( p ) => ( {
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export const Menu: FC<{
174
174
classNames : {
175
175
modal : 'w-[100%] max-w-[1400px] bg-transparent text-textColor' ,
176
176
} ,
177
+ id : 'add-edit-modal' ,
177
178
children : (
178
179
< AddEditModal
179
180
allIntegrations = { integrations . map ( ( p ) => ( {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export const NewPost = () => {
56
56
classNames : {
57
57
modal : 'w-[100%] max-w-[1400px] bg-transparent text-textColor' ,
58
58
} ,
59
+ id : 'add-edit-modal' ,
59
60
children : (
60
61
< AddEditModal
61
62
allIntegrations = { integrations . map ( ( p ) => ( {
Original file line number Diff line number Diff line change @@ -45,13 +45,17 @@ interface State extends ModalManagerStoreInterface {
45
45
46
46
const useModalStore = create < State > ( ( set ) => ( {
47
47
modalManager : [ ] ,
48
- openModal : ( params ) =>
48
+ openModal : ( params ) => {
49
+ const newId = params . id || makeId ( 20 ) ;
49
50
set ( ( state ) => ( {
50
51
modalManager : [
51
52
...state . modalManager ,
52
- { id : params . id || makeId ( 20 ) , ...params } ,
53
+ ...( ! state . modalManager . some ( ( p ) => p . id === newId )
54
+ ? [ { id : newId , ...params } ]
55
+ : [ ] ) ,
53
56
] ,
54
- } ) ) ,
57
+ } ) ) ;
58
+ } ,
55
59
closeById : ( id ) =>
56
60
set ( ( state ) => ( {
57
61
modalManager : state . modalManager . filter ( ( modal ) => modal . id !== id ) ,
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export const Sets: FC = () => {
98
98
withCloseButton : false ,
99
99
removeLayout : true ,
100
100
askClose : true ,
101
+ id : 'add-edit-modal' ,
101
102
children : (
102
103
< AddEditModal
103
104
allIntegrations = { integrations . map ( ( p : any ) => ( {
You can’t perform that action at this time.
0 commit comments