Skip to content

Commit

Permalink
feat: refactoring the MSD
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Nov 21, 2024
1 parent ef47bc6 commit 7fc6be1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/packages/modules-operations/msd/pages/sims-creation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@ import {
shouldDisplayTitleForPrimaryItem,
} from '../../utils';

import Modal from 'react-modal';
import { useBlocker } from 'react-router-dom';
import { ActionToolbar } from '../../../../components/action-toolbar';
import {
CancelButton,
CloseIconButton,
SaveButton,
} from '../../../../components/buttons/buttons-with-icons';
import { Button } from '../../../../components/buttons/button';
import { CloseIconButton } from '../../../../components/buttons/buttons-with-icons';
import { OperationsApi } from '../../../../sdk/operations-api';
import { sortArrayByLabel } from '../../../../utils/array-utils';
import { useGoBack } from '../../../../utils/hooks/useGoBack';
import { rangeType } from '../../../utils/msd';
import { RubricEssentialMsg } from '../../rubric-essantial-msg';
import { DocumentFormPanel } from './document-form-panel';
import { useDocumentsStoreContext } from './documents-store-context';
import { Menu } from './menu';
import './sims-creation.scss';
import { getDefaultSims, getSiblingSims } from './utils/getSims';
import Modal from 'react-modal';
import { Button } from '../../../../components/buttons/button';

const { RICH_TEXT } = rangeType;

Expand Down Expand Up @@ -254,10 +251,7 @@ const SimsCreation = ({

return (
<>
<ActionToolbar>
<CancelButton action={goBackUrl} />
<SaveButton action={handleSubmit} col={3} />
</ActionToolbar>
<Menu goBackUrl={goBackUrl} handleSubmit={handleSubmit} />

<Modal
className="Modal__Bootstrap modal-dialog operations structures-specification-modal"
Expand Down
18 changes: 18 additions & 0 deletions src/packages/modules-operations/msd/pages/sims-creation/menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ActionToolbar } from '../../../../components/action-toolbar';
import {
CancelButton,
SaveButton,
} from '../../../../components/buttons/buttons-with-icons';

type MenuTypes = {
goBackUrl: () => void;
handleSubmit: () => void;
};
export const Menu = ({ goBackUrl, handleSubmit }: Readonly<MenuTypes>) => {
return (
<ActionToolbar>
<CancelButton action={goBackUrl} />
<SaveButton action={handleSubmit} />
</ActionToolbar>
);
};

0 comments on commit 7fc6be1

Please sign in to comment.