From 110dca142fafad7cb57f3faaca468ff24bf6391d Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sat, 21 Dec 2024 09:03:55 +0100 Subject: [PATCH] modal added --- src/component/calendar/EventCalendar.jsx | 3 +- src/component/home/Products.jsx | 5 ++- src/component/product/ProductStart.jsx | 48 +++++++++++++++++++++++- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/component/calendar/EventCalendar.jsx b/src/component/calendar/EventCalendar.jsx index 16234ed..5d03708 100644 --- a/src/component/calendar/EventCalendar.jsx +++ b/src/component/calendar/EventCalendar.jsx @@ -27,8 +27,7 @@ export default function EventCalendar({draggedEvent, setDraggedEvent}) { setMyEvents((prev) => { const existing = prev.find((ev) => ev.id === event.id) ?? {} const filtered = prev.filter((ev) => ev.id !== event.id) - // return [...filtered, { ...existing, start, end, allDay: event.allDay }] - return [...prev] + return [...filtered, { ...existing, start, end, allDay: event.allDay }] }) }, [setMyEvents] diff --git a/src/component/home/Products.jsx b/src/component/home/Products.jsx index 2badff6..67d3893 100644 --- a/src/component/home/Products.jsx +++ b/src/component/home/Products.jsx @@ -3,6 +3,7 @@ import React from 'react' import { productData } from '../../services/services' import queryKeys from '../../services/queryKeys' import productPath from "../../utils/productpath"; +import { Link } from 'react-router-dom'; export default function Products() { const {data, isFetching, isError, error} = useQuery({ @@ -37,7 +38,7 @@ export default function Products() {
{products && products.map((product, index) => (
- +
@@ -47,7 +48,7 @@ export default function Products() {

{product?.description}

-
+
))} diff --git a/src/component/product/ProductStart.jsx b/src/component/product/ProductStart.jsx index c41a02f..256ebc9 100644 --- a/src/component/product/ProductStart.jsx +++ b/src/component/product/ProductStart.jsx @@ -1,5 +1,6 @@ -import React from "react"; +import React, { useRef } from "react"; import getImage from "../../utils/getImage"; +import { Modal } from "bootstrap"; export default function ProductStart(props){ console.log(props) @@ -8,6 +9,16 @@ export default function ProductStart(props){ const productDescription = props.productData.description; const promotion_text = props.productData.promotion_text; + const modalRef = useRef() + + const hideModal = () => { + // modalRef.current.hide() + + // document.body.classList.remove('modal-open') + // const modal = new Modal(document.querySelector('.modal')) + // modal.hide() + } + return ( <>
@@ -37,11 +48,44 @@ export default function ProductStart(props){ {/* Another link*/} {/*
*/}
- Start Product +
+ + {/* Vertical Center Modal */} + + {/* END of Vertical Center Modal */} ) } \ No newline at end of file