From 23b31ef4cc06bd2946e07c348d49b6e96685436f Mon Sep 17 00:00:00 2001 From: Jose Francisco Date: Thu, 7 Mar 2024 15:19:02 +0100 Subject: [PATCH] (feat) Switch datepicker provider to MUI --- package.json | 7 + .../SessionDetailsForm.tsx | 45 +- .../SessionMetaWorkspace.tsx | 8 +- src/group-form-entry-workflow/styles.scss | 16 + yarn.lock | 616 +++++++++++++++++- 5 files changed, 662 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 033536e..763e6dd 100644 --- a/package.json +++ b/package.json @@ -92,9 +92,16 @@ "webpack-cli": "^5.1.4" }, "dependencies": { + "@emotion/react": "^11.11.4", + "@emotion/styled": "^11.11.0", + "@mui/material": "^5.15.12", + "@mui/styled-engine-sc": "^6.0.0-alpha.17", + "@mui/x-date-pickers": "^6.19.6", + "dayjs": "^1.11.10", "i18next": "^21.10.0", "i18next-parser": "^6.6.0", "react-hook-form": "^7.34.2", + "styled-components": "^6.1.8", "turbo": "^1.12.4", "uuid": "^9.0.1" }, diff --git a/src/group-form-entry-workflow/SessionDetailsForm.tsx b/src/group-form-entry-workflow/SessionDetailsForm.tsx index 785ecfc..17d0565 100644 --- a/src/group-form-entry-workflow/SessionDetailsForm.tsx +++ b/src/group-form-entry-workflow/SessionDetailsForm.tsx @@ -1,12 +1,8 @@ -import { - Layer, - Tile, - TextInput, - TextArea, - DatePicker, - DatePickerInput, -} from "@carbon/react"; +import { Layer, Tile, TextInput, TextArea } from "@carbon/react"; import React, { useContext } from "react"; +import { DatePicker, LocalizationProvider } from "@mui/x-date-pickers"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; +import dayjs from "dayjs"; import { useConfig } from "@openmrs/esm-framework"; import { useParams } from "react-router-dom"; import styles from "./styles.scss"; @@ -80,25 +76,22 @@ const SessionDetailsForm = () => { name="sessionDate" control={control} rules={{ required: true }} + defaultValue={dayjs()} render={({ field }) => ( - - - + +
+ + +
+
)} />