diff --git a/src/pages/DashboardPage/DashboardPage.module.css b/src/pages/DashboardPage/DashboardPage.module.css index ce41de1..a8f01a5 100644 --- a/src/pages/DashboardPage/DashboardPage.module.css +++ b/src/pages/DashboardPage/DashboardPage.module.css @@ -1,13 +1,24 @@ -.welcomeMessage { +.dashboardContainer { display: flex; + flex-direction: column; +} + +.CardsContainer { + display: flex; + flex-direction: row; + width: 100%; + justify-content: space-between; gap: 1rem; } + +.dashboardTitle { + font-size: 2rem; + font-weight: 600; +} + /* make purple border around flightsToday */ .cardStyle { - flex-basis: 33.3333%; display: flex; - justify-content: flex-end; - align-items: flex-start; height: 100px; background: transparent; border-radius: 5px; @@ -24,11 +35,49 @@ rgba(250, 251, 252, 1) 33%, rgb(237, 242, 249) 100% ); + flex-basis: 33.33%; } .flightNumber { font-size: 4rem; - font-family: Arial, Helvetica, sans-serif; padding: 1rem 0; color: var(--miracle-color-blue); } + +.dashboardContainer h4 { + font-size: 1.25rem; + font-weight: 600; + margin-bottom: 1rem; + color: var(--miracle-color-blue); +} + +.quickLinkContainer { + display: flex; + flex-direction: row; + justify-content: center; + gap: 1rem; + color: #888787; + background: rgb(250, 251, 252); + background: linear-gradient( + 90deg, + rgba(250, 251, 252, 1) 33%, + rgb(237, 242, 249) 100% + ); + flex-basis: 33.33%; + border-radius: 5px; + border: 1px solid #e1dede; + padding: 2rem 1rem; + transition: all 0.3s; +} + +.quickLinkText { + font-size: 1.25rem; + font-weight: 600; + color: var(--miracle-color-blue); +} + +.quickLinkContainer:hover { + border: 1px solid var(--miracle-color-blue); + cursor: pointer; + transform: scale(1.01); +} diff --git a/src/pages/DashboardPage/DashboardPage.tsx b/src/pages/DashboardPage/DashboardPage.tsx index 0f6f533..0e4e633 100644 --- a/src/pages/DashboardPage/DashboardPage.tsx +++ b/src/pages/DashboardPage/DashboardPage.tsx @@ -1,15 +1,33 @@ import styles from "./DashboardPage.module.css"; +import Rotunda from "./components/Rotunda/Rotunda"; import { useNavigationContext } from "../../context/Navigation.context"; import { Tabs } from "../../layout/SideBar/SideBar.definitions"; import { getDashboardData } from "../../api/queries"; +import Divider from "../../components/Divider/Divider"; +import { DividerSpacing } from "../../components/Divider/Divider.definitions"; import { useEffect } from "react"; import { useQuery } from "@tanstack/react-query"; -import { useAuth } from "@clerk/clerk-react"; +import { useAuth, useUser } from "@clerk/clerk-react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; +import { useNavigate } from "react-router-dom"; import type { DashboardData } from "./DashboardPage.definitions"; const DashboardPage = () => { const { setCurrentTab } = useNavigationContext(); const { getToken } = useAuth(); + const { user } = useUser(); + const navigate = useNavigate(); + + const images = [ + "src/pages/DashboardPage/components/MF_1.jpeg", + "src/pages/DashboardPage/components/MF_2.jpeg", + "src/pages/DashboardPage/components/MF_3.jpeg", + "src/pages/DashboardPage/components/MF_4.jpeg", + "src/pages/DashboardPage/components/MF_5.jpeg", + "src/pages/DashboardPage/components/MF_7.png", + "src/pages/DashboardPage/components/MF_8.webp", + ]; const { data: dashboardData, isLoading: dashboardLoading } = useQuery({ @@ -28,25 +46,67 @@ const DashboardPage = () => { return ( <> -
-
-
- {dashboardData?.["Flights Today"]} -
-
FLIGHTS TODAY
+
+
+ Welcome back, {user?.firstName}!
-
-
- {(Number(dashboardData?.["Flights This Week"]) || 0) + - (Number(dashboardData?.["Flights Today"]) || 0)} + +
+
+
+ {dashboardData?.["Flights Today"]} +
+
FLIGHTS TODAY
+
+
+
+ {(Number(dashboardData?.["Flights This Week"]) || 0) + + (Number(dashboardData?.["Flights Today"]) || 0)} +
+
FLIGHTS THIS WEEK
+
+
+
+ {dashboardData?.["All Total Flights"]} +
+
FLIGHTS TOTAL
-
FLIGHTS THIS WEEK
-
-
- {dashboardData?.["All Total Flights"]} + +

Take a look into Miracle Flights:

+ + +
+
navigate("/request")} + > +
REQUEST FLIGHT
+ +
+
navigate("/passengers")} + > +
PASSENGERS
+ +
+
navigate("/trips")} + > +
YOUR TRIPS
+
-
FLIGHTS EVER
diff --git a/src/pages/DashboardPage/components/MF_1.jpeg b/src/pages/DashboardPage/components/MF_1.jpeg new file mode 100644 index 0000000..5fda1b2 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_1.jpeg differ diff --git a/src/pages/DashboardPage/components/MF_2.jpeg b/src/pages/DashboardPage/components/MF_2.jpeg new file mode 100644 index 0000000..8222112 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_2.jpeg differ diff --git a/src/pages/DashboardPage/components/MF_3.jpeg b/src/pages/DashboardPage/components/MF_3.jpeg new file mode 100644 index 0000000..856c631 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_3.jpeg differ diff --git a/src/pages/DashboardPage/components/MF_4.jpeg b/src/pages/DashboardPage/components/MF_4.jpeg new file mode 100644 index 0000000..4baaf92 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_4.jpeg differ diff --git a/src/pages/DashboardPage/components/MF_5.jpeg b/src/pages/DashboardPage/components/MF_5.jpeg new file mode 100644 index 0000000..b4d5cd6 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_5.jpeg differ diff --git a/src/pages/DashboardPage/components/MF_7.png b/src/pages/DashboardPage/components/MF_7.png new file mode 100644 index 0000000..c634c93 Binary files /dev/null and b/src/pages/DashboardPage/components/MF_7.png differ diff --git a/src/pages/DashboardPage/components/MF_8.webp b/src/pages/DashboardPage/components/MF_8.webp new file mode 100644 index 0000000..752f64f Binary files /dev/null and b/src/pages/DashboardPage/components/MF_8.webp differ diff --git a/src/pages/DashboardPage/components/Rotunda/Rotunda.module.css b/src/pages/DashboardPage/components/Rotunda/Rotunda.module.css new file mode 100644 index 0000000..a03ef10 --- /dev/null +++ b/src/pages/DashboardPage/components/Rotunda/Rotunda.module.css @@ -0,0 +1,63 @@ +.rotundaContainer { + position: relative; + width: 100%; + overflow: hidden; + display: flex; + align-items: center; +} + +.imageContainer { + display: flex; + overflow-x: hidden; + white-space: nowrap; + transition: scroll-left 1s ease-in-out; /* Smoother transition for scrolling */ +} + +.rotundaImage { + width: 320px; + height: 180px; + flex-shrink: 0; + margin-right: 10px; + transition: transform 0.3s ease; +} + +.rotundaImage:hover { + transform: scale(1.05); +} + +.arrow { + position: absolute; + height: 100%; + display: flex; /* Enable flexbox */ + align-items: center; /* Center content vertically */ + justify-content: center; /* Center content horizontally */ + background-color: #fff; + border: none; + color: var(--miracle-color-blue); + cursor: pointer; + font-size: 24px; + padding: 10px; + z-index: 100; + opacity: 0; + transition: opacity 0.3s ease; +} + +.arrow:hover { + opacity: 1; +} + +.Icon { + font-size: 24px; + top: 50%; +} + +.arrow.left { + background: linear-gradient(to left, rgba(255, 255, 255, 0), #fff); + padding-right: 50px; +} + +.arrow.right { + right: 0px; + background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff); + padding-left: 50px; +} diff --git a/src/pages/DashboardPage/components/Rotunda/Rotunda.tsx b/src/pages/DashboardPage/components/Rotunda/Rotunda.tsx new file mode 100644 index 0000000..ec197b4 --- /dev/null +++ b/src/pages/DashboardPage/components/Rotunda/Rotunda.tsx @@ -0,0 +1,112 @@ +import styles from "./Rotunda.module.css"; +import Icon from "../../../../components/CustomIcon/Icon"; +import React, { useEffect, useRef, useState } from "react"; + +type RotundaProps = { + images: string[]; +}; + +const Rotunda: React.FC = ({ images }) => { + const scrollRef = useRef(null); + const [intervalId, setIntervalId] = useState(null); + const [scrollPosition, setScrollPosition] = useState(0); // State to track scroll position + + const scrollAmount = 330; // Image width + margin + const totalWidth = scrollAmount * images.length; // Total width of one full set of images + + const scroll = () => { + if (scrollRef.current) { + const scrollElement = scrollRef.current; + scrollElement.scrollLeft += scrollAmount; + updateScrollPosition(scrollElement.scrollLeft); + if (scrollElement.scrollLeft >= totalWidth) { + scrollElement.scrollLeft -= totalWidth; + updateScrollPosition(scrollElement.scrollLeft); + } + } + }; + + useEffect(() => { + const id = setInterval(scroll, 15000) as unknown as number; + setIntervalId(id); + return () => { + clearInterval(id); + if (scrollRef.current) { + updateScrollPosition(scrollRef.current.scrollLeft); + } + }; + }, []); + + const handleArrowClick = (direction: "left" | "right") => { + if (scrollRef.current) { + const scrollElement = scrollRef.current; + if (direction === "right") { + scrollElement.scrollLeft += scrollAmount; + } else { + scrollElement.scrollLeft -= scrollAmount; + } + updateScrollPosition(scrollElement.scrollLeft); + if (scrollElement.scrollLeft >= totalWidth) { + scrollElement.scrollLeft -= totalWidth; + } else if (scrollElement.scrollLeft < 0) { + scrollElement.scrollLeft += totalWidth; + } + updateScrollPosition(scrollElement.scrollLeft); + } + }; + + const updateScrollPosition = (position: number) => { + setScrollPosition(position); + }; + + const handleMouseEnter = () => { + if (intervalId !== null) { + clearInterval(intervalId); + } + }; + const handleMouseLeave = () => { + const id = setInterval(scroll, 15000) as unknown as number; + setIntervalId(id); + }; + + return ( +
+ {scrollPosition > 0 && ( +
handleArrowClick("left")} + > + +
+ )} +
+ {images.concat(images).map( + ( + image, + index, // Duplicate images for looping + ) => ( + {`Slide + ), + )} +
+
handleArrowClick("right")} + > + +
+
+ ); +}; + +export default Rotunda; diff --git a/src/pages/PassengersPage/components/PatientCard/PatientCard.module.css b/src/pages/PassengersPage/components/PatientCard/PatientCard.module.css index d4ebcf2..d3d323d 100644 --- a/src/pages/PassengersPage/components/PatientCard/PatientCard.module.css +++ b/src/pages/PassengersPage/components/PatientCard/PatientCard.module.css @@ -98,6 +98,15 @@ span { min-height: 10rem; border-radius: 50%; background-color: var(--miracle-color-medium); + display: flex; + justify-content: center; + align-items: center; +} + +.childIcon { + min-width: 6rem; + min-height: 6rem; + color: white; } .info { diff --git a/src/pages/PassengersPage/components/PatientCard/PatientCard.tsx b/src/pages/PassengersPage/components/PatientCard/PatientCard.tsx index 516d7a1..83a1709 100644 --- a/src/pages/PassengersPage/components/PatientCard/PatientCard.tsx +++ b/src/pages/PassengersPage/components/PatientCard/PatientCard.tsx @@ -3,6 +3,8 @@ import { formatDate, getAge } from "../../../../util/date.util"; // import Icon from "../../../../components/CustomIcon/Icon"; import PatientDetailsModal from "../PatientDetailsModal/PatientDetailsModal"; import { useState } from "react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faChildReaching } from "@fortawesome/free-solid-svg-icons"; import type { PatientProps } from "./PatientCard.definitions"; /** @@ -27,7 +29,12 @@ const Patient = ({ patient }: PatientProps) => { )}
setModal(true)}>
-
+
+ +
{patient["First Name"]} {patient["Last Name"]}