Skip to content

Commit

Permalink
Merge pull request #129 from upendraTekdi/admin_uk
Browse files Browse the repository at this point in the history
 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
  • Loading branch information
itsvick authored Aug 13, 2024
2 parents 4309843 + 49337fe commit 018e4f4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
15 changes: 11 additions & 4 deletions src/components/AddNewCenters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ const AddNewCenters: React.FC<AddLearnerModalProps> = ({
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")}
Expand All @@ -237,8 +241,11 @@ const AddNewCenters: React.FC<AddLearnerModalProps> = ({
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);
Expand Down
33 changes: 22 additions & 11 deletions src/pages/centers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]>([
getUserStateName,
]);
const [selectedState, setSelectedState] = React.useState<string[]>([]);
const [selectedDistrict, setSelectedDistrict] = React.useState<string[]>([]);
const [selectedBlock, setSelectedBlock] = React.useState<string[]>([]);
const [selectedSort, setSelectedSort] = useState("Sort");
Expand All @@ -114,7 +112,7 @@ const Center: React.FC = () => {
const [pageSizeArray, setPageSizeArray] = React.useState<number[]>([]);
const [filters, setFilters] = useState<cohortFilterDetails>({
type: "COHORT",
states:stateCode
// states: stateCode,
});
const [sortBy, setSortBy] = useState(["createdAt", "asc"]);
const [selectedStateCode, setSelectedStateCode] = useState("");
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -645,6 +648,8 @@ const Center: React.FC = () => {
handleAddUserClick: handleAddUserClick,
};



return (
<>
{/* <CustomModal
Expand Down Expand Up @@ -763,8 +768,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={onCloseEditForm}
>
Expand All @@ -775,8 +783,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);
Expand Down
4 changes: 4 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 018e4f4

Please sign in to comment.