From 0b4449e36fee7981c1538c52f42f614849d294b7 Mon Sep 17 00:00:00 2001 From: upendraTekdi Date: Tue, 13 Aug 2024 15:29:31 +0530 Subject: [PATCH] Task #223115: change button size and style on create new center form and update center form,change style for table head ,remove stateName initial set from zustand use --- src/components/AddNewCenters.tsx | 15 +++++++++++---- src/pages/centers.tsx | 33 +++++++++++++++++++++----------- src/styles/globals.css | 4 ++++ 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/components/AddNewCenters.tsx b/src/components/AddNewCenters.tsx index 1a978431..5e721d87 100644 --- a/src/components/AddNewCenters.tsx +++ b/src/components/AddNewCenters.tsx @@ -225,9 +225,13 @@ const AddNewCenters: React.FC = ({ type="submit" form="new-center-form" // Add this line sx={{ - padding: "12px 24px", // Adjust padding as needed - width: "200px", // Set the desired width + fontSize: "14px", + fontWeight: "500", + width: "auto", + height: "40px", + marginLeft: "10px", }} + onClick={onClose} > {t("COMMON.CANCEL")} @@ -237,8 +241,11 @@ const AddNewCenters: React.FC = ({ type="submit" form="new-center-form" // Add this line sx={{ - padding: "12px 24px", // Adjust padding as needed - width: "200px", // Set the desired width + fontSize: "14px", + fontWeight: "500", + width: "auto", + height: "40px", + marginLeft: "10px", }} onClick={() => { setSubmittedButtonStatus(true); diff --git a/src/pages/centers.tsx b/src/pages/centers.tsx index 3295d60e..caba2c14 100644 --- a/src/pages/centers.tsx +++ b/src/pages/centers.tsx @@ -85,9 +85,7 @@ const Center: React.FC = () => { const getUserStateName = state ? state.value : null; const stateCode = state ? state?.code : null; // handle states - const [selectedState, setSelectedState] = React.useState([ - getUserStateName, - ]); + const [selectedState, setSelectedState] = React.useState([]); const [selectedDistrict, setSelectedDistrict] = React.useState([]); const [selectedBlock, setSelectedBlock] = React.useState([]); const [selectedSort, setSelectedSort] = useState("Sort"); @@ -114,7 +112,7 @@ const Center: React.FC = () => { const [pageSizeArray, setPageSizeArray] = React.useState([]); const [filters, setFilters] = useState({ type: "COHORT", - states:stateCode + // states: stateCode, }); const [sortBy, setSortBy] = useState(["createdAt", "asc"]); const [selectedStateCode, setSelectedStateCode] = useState(""); @@ -282,15 +280,20 @@ const Center: React.FC = () => { setSelectedState(selected); if (selected[0] === "") { - if (filters.status) setFilters({ type: "COHORT",status: filters.status }); + if (filters.status) + setFilters({ type: "COHORT", status: filters.status }); // else setFilters({ role: role }); } else { const stateCodes = code?.join(","); console.log("stateCodes", stateCodes); setSelectedStateCode(stateCodes); if (filters.status) - setFilters({ type: "COHORT", status: filters.status, states: stateCodes }); - else setFilters({ type: "COHORT",states: stateCodes }); + setFilters({ + type: "COHORT", + status: filters.status, + states: stateCodes, + }); + else setFilters({ type: "COHORT", states: stateCodes }); } console.log("Selected categories:", typeof code[0]); @@ -642,6 +645,8 @@ const Center: React.FC = () => { handleAddUserClick: handleAddUserClick, }; + + return ( <> {/* { type="submit" form="update-center-form" // Add this line sx={{ - padding: "12px 24px", // Adjust padding as needed - width: "200px", // Set the desired width + fontSize: "14px", + fontWeight: "500", + width: "auto", + height: "40px", + marginLeft: "10px", }} onClick={onCloseEditForm} > @@ -772,8 +780,11 @@ const Center: React.FC = () => { type="submit" form="update-center-form" // Add this line sx={{ - padding: "12px 24px", // Adjust padding as needed - width: "200px", // Set the desired width + fontSize: "14px", + fontWeight: "500", + width: "auto", + height: "40px", + marginLeft: "10px", }} onClick={() => { setSubmittedButtonStatus(true); diff --git a/src/styles/globals.css b/src/styles/globals.css index e22415ea..f2a3cfbd 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -75,3 +75,7 @@ ul.MuiList-root li.MuiMenuItem-root[data-value=""] { .Toastify__toast-icon svg { fill: #fff !important; } + +.ka-thead-cell { + font-weight: 600; +}