Skip to content

Commit 80f24c9

Browse files
authored
[frontend]Change team creation/update to drawer(#3468)
1 parent 2166a5e commit 80f24c9

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

openbas-front/src/admin/components/components/teams/CreateTeam.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { makeStyles } from 'tss-react/mui';
66
import { type TeamInputForm } from '../../../../actions/teams/Team';
77
import { addTeam } from '../../../../actions/teams/team-actions';
88
import Dialog from '../../../../components/common/dialog/Dialog';
9+
import Drawer from '../../../../components/common/Drawer';
910
import { useFormatter } from '../../../../components/i18n';
1011
import { type Team, type TeamCreateInput } from '../../../../utils/api-types';
1112
import { useAppDispatch } from '../../../../utils/hooks';
@@ -86,17 +87,32 @@ const CreateTeam: FunctionComponent<CreateTeamProps> = ({
8687
<Add />
8788
</Fab>
8889
)}
89-
<Dialog
90-
open={openDialog}
91-
handleClose={handleClose}
92-
title={t('Create a new team')}
93-
>
94-
<TeamForm
95-
initialValues={{ team_tags: [] }}
90+
{inline ? (
91+
<Dialog
92+
open={openDialog}
93+
handleClose={handleClose}
94+
title={t('Create a new team')}
95+
>
96+
<TeamForm
97+
initialValues={{ team_tags: [] }}
98+
handleClose={handleClose}
99+
onSubmit={onSubmit}
100+
/>
101+
</Dialog>
102+
) : (
103+
<Drawer
104+
open={openDialog}
96105
handleClose={handleClose}
97-
onSubmit={onSubmit}
98-
/>
99-
</Dialog>
106+
title={t('Create a new team')}
107+
>
108+
<TeamForm
109+
initialValues={{ team_tags: [] }}
110+
handleClose={handleClose}
111+
onSubmit={onSubmit}
112+
/>
113+
</Drawer>
114+
)}
115+
100116
</div>
101117
);
102118
};

0 commit comments

Comments
 (0)