From a571b8220a668ce6075d6cb3b1d81a556801f070 Mon Sep 17 00:00:00 2001 From: Hoang-Nguyen-Huy Date: Sat, 28 Sep 2024 14:03:14 +0700 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20click=20on=20picture=20?= =?UTF-8?q?to=20show=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MainContent/Content.jsx | 4 +- src/components/MainContent/OrchidCard.jsx | 67 +++++++++++++---------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/components/MainContent/Content.jsx b/src/components/MainContent/Content.jsx index a8a93e2..8a78106 100644 --- a/src/components/MainContent/Content.jsx +++ b/src/components/MainContent/Content.jsx @@ -12,7 +12,7 @@ export default function Content() { {Orchids.map((orchid) => { return ( - + ); diff --git a/src/components/MainContent/OrchidCard.jsx b/src/components/MainContent/OrchidCard.jsx index 50c051f..01b8237 100644 --- a/src/components/MainContent/OrchidCard.jsx +++ b/src/components/MainContent/OrchidCard.jsx @@ -4,11 +4,13 @@ import Card from "@mui/joy/Card"; import CardContent from "@mui/joy/CardContent"; import CardOverflow from "@mui/joy/CardOverflow"; import Divider from "@mui/joy/Divider"; -import { Rating } from "@mui/material"; +import { Button, Rating } from "@mui/material"; import useModal from "../../hooks/useModal"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Modal from "@mui/material/Modal"; +import LocationOnIcon from "@mui/icons-material/LocationOn"; +import CategoryIcon from "@mui/icons-material/Category"; const style = { position: "absolute", @@ -24,7 +26,7 @@ const style = { }; export default function OrchidCard({ orchid }) { - const { isVisible, detail, showModal, hideModal } = useModal({ orchid }); + const { isVisible, showModal, hideModal } = useModal({ orchid }); return ( <> @@ -38,10 +40,13 @@ export default function OrchidCard({ orchid }) { boxShadow: "0 0 10px rgba(255, 255, 255, 0.8)", }, }} - onClick={() => showModal(orchid)} > - + showModal(orchid)} + > {orchid.name} - - {orchid.origin} - + + + + {orchid.origin} + + + + {orchid.category} + + - - {/* - {orchid.rating} rating - */} - - - {orchid.category} - +