Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event stats #36

Open
wants to merge 41 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
09795f2
init layout and styling
isa-leroux448 Jul 21, 2024
5e3ddf1
add tailwind styling and refactor
isa-leroux448 Jul 21, 2024
0d2055b
add responsiveness
isa-leroux448 Jul 21, 2024
bfbe843
add navbar profile link
isa-leroux448 Jul 21, 2024
16bbc2c
replace bizbot svg with png
isa-leroux448 Jul 30, 2024
e04139c
achieved front-end view for pop up. just need to plan how the data wi…
m20arcusk Jul 30, 2024
8b3ce41
frontend visuals achieved, just need to refactor the method the data …
m20arcusk Aug 2, 2024
0960883
updated and imported some types for the questions and respones as wel…
m20arcusk Aug 8, 2024
7a29faa
small fix on a comment
m20arcusk Aug 8, 2024
a519108
didn't mean to delete BasicInformation in types.ts so I added it back
m20arcusk Aug 8, 2024
a3279ab
update mock registrant data
isa-leroux448 Aug 12, 2024
f22c4b2
create percentage bar component
isa-leroux448 Aug 12, 2024
811fdb6
create basic layout
isa-leroux448 Aug 13, 2024
a5d779f
make charts responsive on horizontal resize
isa-leroux448 Aug 13, 2024
bdf2754
removed console.log testing lines and updated tailwind with divider c…
m20arcusk Aug 14, 2024
d16fc21
updated the fetchQuestion function to use async and await
m20arcusk Aug 14, 2024
37d9f2a
fetch backend
AllanT102 Aug 15, 2024
58753d5
add responsiveness
isa-leroux448 Aug 15, 2024
3e2f2dc
responsiveness fixes
isa-leroux448 Aug 15, 2024
347bd40
code clean up
isa-leroux448 Aug 15, 2024
b6eb611
Merge branch 'dev' of https://github.com/ubc-biztech/bt-web-v2 into e…
isa-leroux448 Aug 15, 2024
2cce179
fetch backend
AllanT102 Aug 15, 2024
be3925a
Delete .env
AllanT102 Aug 15, 2024
1aef301
ignore
AllanT102 Aug 15, 2024
f817709
changed to use async and await and now grabbing user responses from r…
m20arcusk Aug 16, 2024
0f6fb2a
update types
isa-leroux448 Aug 17, 2024
ece81fb
comment out edit text
isa-leroux448 Aug 17, 2024
1fa423d
update date handling in profile event card
isa-leroux448 Aug 17, 2024
a712364
Merge branch 'dev' of https://github.com/ubc-biztech/bt-web-v2 into p…
isa-leroux448 Aug 17, 2024
34adaa5
move head
isa-leroux448 Aug 17, 2024
edbbf14
updated userResponse type and changed how it is accessed in userRespo…
m20arcusk Aug 17, 2024
8185620
Merge pull request #37 from ubc-biztech/fetchbackend
AllanT102 Aug 17, 2024
5ab669a
resolved merge conflicts
m20arcusk Aug 18, 2024
231e7ec
Merge pull request #34 from ubc-biztech/registration-user-popup
m20arcusk Aug 18, 2024
d5c4fea
Merge branch 'dev' of https://github.com/ubc-biztech/bt-web-v2 into p…
isa-leroux448 Aug 19, 2024
38064ee
Merge pull request #26 from ubc-biztech/profile-page
isa-leroux448 Aug 19, 2024
af530d7
add chart empty states
isa-leroux448 Aug 19, 2024
9edec04
replace Attendee type with Registration
isa-leroux448 Aug 20, 2024
d1bb883
Merge branch 'event-stats' of https://github.com/ubc-biztech/bt-web-v…
isa-leroux448 Aug 26, 2024
cf8ce98
fix attendee table popup nested object issues
isa-leroux448 Aug 26, 2024
2227669
fix package-lock file
isa-leroux448 Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ next-env.d.ts
.amplify
#amplify_outputs*
amplifyconfiguration*

.env
5,690 changes: 3,112 additions & 2,578 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,28 @@
"lint": "next lint"
},
"dependencies": {
"@radix-ui/react-avatar": "^1.1.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^5.15.21",
"@mui/material": "^5.15.21",
"@aws-amplify/adapter-nextjs": "^1.2.10",
"@aws-amplify/auth": "^6.3.7",
"@aws-amplify/ui-react": "^6.1.12",
"aws-amplify": "^6.3.8",
"@radix-ui/react-checkbox": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.1",
"@tanstack/react-table": "^8.17.3",
"aws-amplify": "^6.3.8",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^11.2.10",
"lodash": "^4.17.21",
"lucide-react": "^0.396.0",
"next": "14.2.3",
"react": "^18",
Expand Down
Binary file added public/assets/bizbot_peeking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/bookmark_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/exec_status_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/member_status_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/non-member_status_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/pencil_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/icons/registered_events_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions src/components/ProfilePage/ProfileEventCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Card, CardFooter } from "@/components/ui/card";
import Image from "next/image";
import placeHolderImage from "../../assets/event-placeholder.jpeg";
import { extractTime, extractMonthDay } from "@/util/extractDateAndTime";
import { BiztechEvent } from "@/types";
import { isMobile } from "@/util/isMobile";
import { useState, useEffect } from "react";

interface ProfileEventCardProps {
initialData: BiztechEvent | null;
}

const ProfileEventCard: React.FC<ProfileEventCardProps> = ({ initialData }) => {
const startTime = initialData?.startDate
? extractTime(initialData.startDate)
: "";
const dateTime = initialData?.startDate
? extractMonthDay(initialData.startDate)
: "";
const displayDate = initialData
? startTime + " " + dateTime
: "Event not Found";
const [isMobileDevice, setIsMobileDevice] = useState(false);
useEffect(() => {
const userAgent = navigator.userAgent;
setIsMobileDevice(isMobile(userAgent));
}, []);
return (
<Card
className="w-1/3 border-none bg-events-card-bg"
style={{ width: isMobileDevice ? "50%" : "33%" }}
>
<Image
src={placeHolderImage}
alt="event-image"
className="w-full h-[100px] rounded-t-lg"
/>
<CardFooter className="font-poppins p-3 gap-0.5 flex flex-col text-left items-start">
<h6 className="text-white font-500 text-sm">{initialData?.ename}</h6>
<p className="text-baby-blue text-xs">{displayDate}</p>
</CardFooter>
</Card>
);
};

export default ProfileEventCard;
20 changes: 20 additions & 0 deletions src/components/ProfilePage/ProfileRow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const ProfileField = ({
field,
value,
className,
}: {
field: string;
value: string;
className?: string;
}) => {
return (
<div className={`w-1/2 font-poppins ${className}`}>
<h6 className="text-baby-blue text-sm">{field}</h6>
<p className="text-white text-xs">{value}</p>
</div>
);
};

export const ProfileRow = ({ children }: { children: React.ReactNode }) => {
return <div className="flex my-3">{children}</div>;
};
32 changes: 32 additions & 0 deletions src/components/ProfilePage/TextIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Image, { StaticImageData } from "next/image";

interface TextIconProps {
text: any;
icon: string;
iconSize: number;
iconAtEnd?: boolean;
className?: string;
}

const TextIcon: React.FC<TextIconProps> = ({
text,
icon,
iconSize,
iconAtEnd = false,
className,
}) => {
return (
<div
className={`flex items-center gap-3 ${className}`}
style={{
flexDirection: iconAtEnd ? "row" : "row-reverse",
justifyContent: "start",
}}
>
{text}
<Image src={icon} alt="Icon" width={iconSize} height={iconSize} />
</div>
);
};

export default TextIcon;
81 changes: 81 additions & 0 deletions src/components/ProfilePage/UserEvents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import Image from "next/image";
import Link from "next/link";
import * as Separator from "@radix-ui/react-separator";
import TextIcon from "./TextIcon";
import ProfileEventCard from "./ProfileEventCard";
import RegisteredIcon from "../../../public/assets/icons/registered_events_icon.svg";
import SavedIcon from "../../../public/assets/icons/bookmark_icon.svg";
import BizBot from "../../../public/assets/bizbot_peeking.png";
import { BiztechEvent } from "@/types";
import { isMobile } from "@/util/isMobile";
import { useState, useEffect } from "react";

interface UserEventsProps {
registeredEvents: BiztechEvent[];
savedEvents: BiztechEvent[];
}

export const UserEvents: React.FC<UserEventsProps> = ({
registeredEvents,
savedEvents,
}) => {
const [isMobileDevice, setIsMobileDevice] = useState(false);
useEffect(() => {
const userAgent = navigator.userAgent;
setIsMobileDevice(isMobile(userAgent));
}, []);
return (
<div className="relative bg-profile-card-bg rounded-md p-6 w-full lg:w-[55%]">
<Image
src={BizBot}
alt="BizBot"
className="absolute top-[-150px] right-[-10px] h-[150px] w-[auto] hidden lg:block"
/>
<h4 className="text-biztech-green">Your Events</h4>
<Separator.Root className="SeparatorRoot my-3 mx-0 bg-profile-separator-bg h-[0.5px]" />
<TextIcon
className="mb-4"
text={<h5 className="text-white">Registered</h5>}
icon={RegisteredIcon}
iconSize={24}
/>
<div
className="flex items-center justify-center gap-6 mb-6"
style={{
flexDirection: registeredEvents.length === 0 ? "column" : "row",
}}
>
{registeredEvents.length === 0 ? (
<h6 className="text-baby-blue text-center">No registered events</h6>
) : (
registeredEvents
.slice(isMobileDevice ? -2 : -3)
.map((event) => <ProfileEventCard initialData={event} key={event.id} />)
)}
</div>

<TextIcon
className="my-4"
text={<h5 className="text-white">Saved</h5>}
icon={SavedIcon}
iconSize={24}
/>
<div
className="flex flex-col items-center justify-center gap-6"
style={{ flexDirection: savedEvents.length === 0 ? "column" : "row" }}
>
{savedEvents.length === 0 ? (
<h6 className="text-baby-blue text-center">No saved events</h6>
) : (
savedEvents
.slice(isMobileDevice ? -2 : -3)
.map((event) => <ProfileEventCard initialData={event} key={event.id} />)
)}
</div>
<Separator.Root className="SeparatorRoot my-6 mx-0 bg-profile-separator-bg h-[0.5px]" />
<Link href="">
<p className="text-white text-right underline text-xs">View all</p>
</Link>
</div>
);
};
Loading