Skip to content

Commit

Permalink
Merge pull request #111 from shapehq/develop
Browse files Browse the repository at this point in the history
Deploy to production
  • Loading branch information
simonbs authored Oct 30, 2023
2 parents fbb993b + a20da6e commit cab3024
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
7 changes: 5 additions & 2 deletions src/common/ui/MenuItemHover.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { ReactNode } from "react"
import { SxProps } from "@mui/system"
import { Box } from "@mui/material"
import useMediaQuery from "@mui/material/useMediaQuery"

const MenuItemHover = ({
disabled,
children
children,
sx
}: {
disabled?: boolean
children: ReactNode
sx?: SxProps
}) => {
const isHoverSupported = useMediaQuery("(hover: hover)")
const classNames = ["menu-item-highlight"]
Expand All @@ -23,7 +26,7 @@ const MenuItemHover = ({
}
}
return (
<Box className={classNames.join(" ")} sx={{ width: "100%" }}>
<Box className={classNames.join(" ")} sx={{ ...sx, width: "100%" }}>
{children}
</Box>
)
Expand Down
28 changes: 11 additions & 17 deletions src/features/projects/view/ProjectListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,24 @@ import MenuItemHover from "@/common/ui/MenuItemHover"
import Project from "../domain/Project"
import ProjectAvatar from "./ProjectAvatar"

const ProjectListItem = (
{
project,
isSelected,
onSelectProject
}: {
project: Project
isSelected: boolean
onSelectProject: (project: Project) => void
}
) => {
const ProjectListItem = ({
project,
isSelected,
onSelectProject
}: {
project: Project
isSelected: boolean
onSelectProject: (project: Project) => void
}) => {
return (
<ListItem disablePadding>
<ListItemButton
onClick={() => onSelectProject(project)}
selected={isSelected}
disableGutters
sx={{
padding: 0,
marginTop: 0.5,
marginBottom: 0.5
}}
sx={{ padding: 0 }}
>
<MenuItemHover>
<MenuItemHover sx={{ marginTop: 0.5, marginBottom: 0.5 }}>
<Stack direction="row" alignItems="center" spacing={1}>
<ProjectAvatar project={project} width={40} height={40} />
<ListItemText
Expand Down

0 comments on commit cab3024

Please sign in to comment.