diff --git a/src/AboutUs.jsx b/src/AboutUs.jsx index 2f09e57d..acd9be6f 100644 --- a/src/AboutUs.jsx +++ b/src/AboutUs.jsx @@ -4,7 +4,7 @@ const AboutUs = () => { return (
- Welcome to BudgetEase Solutions, your trusted partner in simplifying budget management and financial solutions. At BudgetEase, we understand the importance of effective budget planning and strive to provide intuitive, user-friendly solutions to meet the diverse needs of our clients. + Welcome to BudgetEase Solutions Company limited, your trusted partner in simplifying budget management and financial solutions. At BudgetEase, we understand the importance of effective budget planning and strive to provide intuitive, user-friendly solutions to meet the diverse needs of our clients.
With a commitment to efficiency and innovation, we empower individuals and businesses to take control of their finances and achieve their goals with ease.
At BudgetEase Solutions, our mission is to make budgeting effortless and accessible for everyone. Whether you're a small business owner, a busy professional, or an individual looking to manage your personal finances, we offer tailored solutions to streamline your budgeting process. diff --git a/src/App.css b/src/App.css index 85c14030..ff968c57 100644 --- a/src/App.css +++ b/src/App.css @@ -7,7 +7,7 @@ .first_page { display: flex; height: 100vh; - background-image: url("https://cdn.pixabay.com/photo/2018/07/05/14/45/conference-3518465_1280.jpg"); + background-image: url("https://cdn.pixabay.com/photo/2025/03/28/17/58/flowers-9499374_1280.jpg"); background-size: cover; background-position: center; justify-content: center; diff --git a/src/ConferenceEvent.jsx b/src/ConferenceEvent.jsx index 612a4648..41e91298 100644 --- a/src/ConferenceEvent.jsx +++ b/src/ConferenceEvent.jsx @@ -1,12 +1,16 @@ import React, { useState } from "react"; import "./ConferenceEvent.css"; import TotalCost from "./TotalCost"; +import { toggleMealSelection } from "./mealsSlice"; +import { incrementAvQuantity, decrementAvQuantity } from "./avSlice"; import { useSelector, useDispatch } from "react-redux"; import { incrementQuantity, decrementQuantity } from "./venueSlice"; const ConferenceEvent = () => { const [showItems, setShowItems] = useState(false); const [numberOfPeople, setNumberOfPeople] = useState(1); const venueItems = useSelector((state) => state.venue); + const avItems = useSelector((state) => state.av); + const mealsItems = useSelector((state) => state.meals); const dispatch = useDispatch(); const remainingAuditoriumQuantity = 3 - venueItems.find(item => item.name === "Auditorium Hall (Capacity:200)").quantity; @@ -29,35 +33,111 @@ const ConferenceEvent = () => { } }; const handleIncrementAvQuantity = (index) => { - }; + dispatch(incrementAvQuantity(index)); +}; - const handleDecrementAvQuantity = (index) => { - }; +const handleDecrementAvQuantity = (index) => { + dispatch(decrementAvQuantity(index)); +}; - const handleMealSelection = (index) => { - - }; +const handleMealSelection = (index) => { + const item = mealsItems[index]; + if (item.selected && item.type === "mealForPeople") { + // Ensure numberOfPeople is set before toggling selection + const newNumberOfPeople = item.selected ? numberOfPeople : 0; + dispatch(toggleMealSelection(index, newNumberOfPeople)); + } + else { + dispatch(toggleMealSelection(index)); + } +}; - const getItemsFromTotalCost = () => { - const items = []; - }; +const getItemsFromTotalCost = () => { + const items = []; + venueItems.forEach((item) => { + if (item.quantity > 0) { + items.push({ ...item, type: "venue" }); + } + }); + avItems.forEach((item) => { + if ( + item.quantity > 0 && + !items.some((i) => i.name === item.name && i.type === "av") + ) { + items.push({ ...item, type: "av" }); + } + }); + mealsItems.forEach((item) => { + if (item.selected) { + const itemForDisplay = { ...item, type: "meals" }; + if (item.numberOfPeople) { + itemForDisplay.numberOfPeople = numberOfPeople; + } + items.push(itemForDisplay); + } + }); + return items; + }; const items = getItemsFromTotalCost(); const ItemsDisplay = ({ items }) => { - + console.log(items); + return <> +
No items selected
} +| Name | +Unit Cost | +Quantity | +Subtotal | +
|---|---|---|---|
| {item.name} | +${item.cost} | ++ {item.type === "meals" || item.numberOfPeople + ? ` For ${numberOfPeople} people` + : item.quantity} + | +{item.type === "meals" || item.numberOfPeople + ? `${item.cost * numberOfPeople}` + : `${item.cost * item.quantity}`} + | +