-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move the display change as a new component
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
22 changes: 22 additions & 0 deletions
22
application/frontend/src/components/ViewModeToggle/ViewModeToggle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react" | ||
|
||
import ViewListIcon from "@mui/icons-material/ViewList" | ||
import ViewModuleIcon from "@mui/icons-material/ViewModule" | ||
import { IconButton } from "@mui/material" | ||
|
||
interface ViewModeToggleProps { | ||
viewMode: "list" | "grid" | ||
onToggleViewMode: () => void | ||
} | ||
|
||
export const ViewModeToggle: React.FC<ViewModeToggleProps> = ({ viewMode, onToggleViewMode }) => { | ||
return ( | ||
<div> | ||
<IconButton onClick={onToggleViewMode}> | ||
{viewMode === "list" ? <ViewModuleIcon /> : <ViewListIcon />} | ||
</IconButton> | ||
</div> | ||
) | ||
} | ||
|
||
export default ViewModeToggle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ViewModeToggle } from "./ViewModeToggle" |