diff --git a/package.json b/package.json index 20e6f38..8066004 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@radix-ui/themes": "^2.0.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -10,7 +11,11 @@ "react": "^18.2.0", "react-datetime-picker": "^5.5.2", "react-dom": "^18.2.0", + "react-router": "^6.16.0", + "react-router-dom": "^6.16.0", "react-scripts": "5.0.1", + "tsc": "^2.0.4", + "typescript": "^5.2.2", "web-vitals": "^2.1.4" }, "scripts": { @@ -36,5 +41,10 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "@types/react": "^18.2.25", + "@types/react-dom": "^18.2.10", + "file-loader": "^6.2.0" } } diff --git a/src/App.css b/src/App.css index 4ba232d..280e052 100644 --- a/src/App.css +++ b/src/App.css @@ -20,12 +20,30 @@ max-height: 450px; margin-bottom: 50px; z-index: 5; + + box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); + + max-height: 500px; + max-width: 500px; + + border-radius: 50%; + overflow: hidden; + + transform: translateX(-50px); } .parlour-img-holder img { /* width: 75%; */ - max-height: 100%; - box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); + /* max-height: 100%; */ + height: 500px; + width: 500px; + border-radius: 50%; + cursor: pointer; +} + +.parlour-img-holder img:hover { + transition: transform 0.6s; + transform: scale(1.5); } .skew-bg1 { @@ -35,7 +53,7 @@ position: absolute; top: -100px; right: -300px; - transform: skew(20deg) rotate(-45deg); + transform: skew(20deg) rotate(-40deg); z-index: 0; background: rgb(56, 179, 236); background: linear-gradient( @@ -62,3 +80,29 @@ transform: skew(20deg) rotate(45deg); z-index: 0; } + +.skew-bg1-square { + width: 50px; + height: 50px; + background-color: burlywood; + animation: sqew-sq1 5s linear infinite; + position: relative; + right: -100%; +} + +@keyframes sqew-sq1 { + 0% { + transform: rotate(0deg); + opacity: 100%; + } + + 50% { + transform: rotate(180deg); + opacity: 80%; + } + + 100% { + transform: rotate(360deg); + opacity: 100%; + } +} diff --git a/src/App.js b/src/App.tsx similarity index 59% rename from src/App.js rename to src/App.tsx index f72222b..fbac914 100644 --- a/src/App.js +++ b/src/App.tsx @@ -1,18 +1,12 @@ -import Services from "./components/Services"; +import React from "react"; import "./App.css"; -import HaircutImg from "./assets/haircut1.jpg"; - -import facialImg from "./assets/facial.jpg"; -import parlourImg from "./assets/parlour.jpg"; import servicesList from "./constants/services"; // import HaircutImg from "./assets/haircut1.jpg"; import { useEffect, useState } from "react"; -import DatePicker from "./components/DatePicker"; -import DateSelected from "./components/DateSelected"; -import Slots from "./components/Slots"; import dayjs from "dayjs"; import Header from "./components/Header"; +import Home from "./pages/Home"; function App() { const [services, setServices] = useState({}); @@ -45,15 +39,10 @@ function App() { }); }, []); - const selectedServicesHandler = (service, isSelected) => { - setSelectedServices( - (prevSel) => { - return new Set([...prevSel, service]); - }, - () => { - console.log({ selectedServices }); - } - ); + const selectedServicesHandler = (service: any, isSelected: boolean) => { + setSelectedServices((prevSel) => { + return new Set([...prevSel, service]); + }); }; const setDateHandler = (value) => { @@ -85,21 +74,16 @@ function App() { return (
x
{slotSelected === slot?.id && ✔} diff --git a/src/components/Slots/index.js b/src/components/Slots/index.tsx similarity index 80% rename from src/components/Slots/index.js rename to src/components/Slots/index.tsx index a254abf..b4886af 100644 --- a/src/components/Slots/index.js +++ b/src/components/Slots/index.tsx @@ -4,9 +4,9 @@ import "./Slots.css"; function Slots({ slots, setSlot, slotSelected }) { const slotsRef = React.createRef(); - useEffect(() => { - slotsRef?.current?.scrollIntoView({ behavior: "smooth" }); - }, []); + // useEffect(() => { + // slotsRef?.current?.scrollIntoView({ behavior: "smooth" }); + // }, []); return ( ))} {slotSelected && } - + {/* */} ); } diff --git a/src/constants/services.js b/src/constants/services.ts similarity index 96% rename from src/constants/services.js rename to src/constants/services.ts index 9ec3632..e0af22b 100644 --- a/src/constants/services.js +++ b/src/constants/services.ts @@ -1,3 +1,4 @@ +// const HaircutImg = "haircut1.jpg"; import HaircutImg from "../assets/haircut1.jpg"; import facialImg from "../assets/facial.jpg"; diff --git a/src/index.js b/src/index.tsx similarity index 100% rename from src/index.js rename to src/index.tsx diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx new file mode 100644 index 0000000..af76169 --- /dev/null +++ b/src/pages/Home/index.tsx @@ -0,0 +1,50 @@ +import React, { ReactElement } from "react"; +import DatePicker from "../../components/DatePicker"; +import DateSelected from "../../components/DateSelected"; +import Services from "../../components/Services"; +import Slots from "../../components/Slots"; +import parlourImg from "../../assets/parlour.jpg"; + +type homeTypes = { + services: any; + selectedServicesHandler: Function; + setDateHandler: Function; + setSlotHandler: Function; + slots: any[]; + selectedServices: any; + date: any; + slot: any; +}; + +function Home({ + services, + selectedServicesHandler, + setDateHandler, + setSlotHandler, + slots, + selectedServices, + date, + slot, +}: homeTypes): ReactElement { + return ( +