Skip to content

Commit

Permalink
fix: Update hospital edit payload and edit button styles
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Oct 14, 2024
1 parent bdd55c3 commit 28e1382
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const EditHospital = () => {
dispatch(
updateHospital({
code: hospital!.code!!,
hospitalDTO: { ...value, code: hospital!.code },
hospitalDTO: { ...hospital, ...value },
})
);
};
Expand Down
5 changes: 2 additions & 3 deletions src/components/accessories/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ const Button: FunctionComponent<IProps> = ({
disabled,
dataCy,
onClick,
sx,
className,
}) => {
return (
<MaterialComponent
className="button"
className={"button " + className ?? ""}
type={type}
color={color}
variant={variant}
disableElevation
disabled={disabled}
onClick={onClick}
sx={sx}
data-cy={dataCy}
>
{children}
Expand Down
5 changes: 2 additions & 3 deletions src/components/accessories/button/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ButtonProps, SxProps } from "@mui/material";
import { Theme } from "@mui/system";
import { ButtonProps } from "@mui/material";
import { PropsWithChildren } from "react";

export interface IProps extends PropsWithChildren {
Expand All @@ -8,6 +7,6 @@ export interface IProps extends PropsWithChildren {
color?: ButtonProps["color"] | undefined;
disabled?: boolean;
dataCy?: string;
sx?: SxProps<Theme>;
className?: string;
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
gap: 8px;
}

.editButton {
color: black !important;
background-color: white !important;
&:hover {
background-color: gray !important;
}
}

.item {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ const SideMenu = () => {
type="button"
variant="text"
dataCy="edit-hospital"
sx={{
color: "black",
backgroundColor: "white",
"&:hover": { backgroundColor: "gray" },
}}
className={classes.editButton}
onClick={() => {
navigate(PATHS.admin_hospital_edit);
}}
Expand Down

0 comments on commit 28e1382

Please sign in to comment.