Skip to content

Commit aebd41b

Browse files
committed
Add Calendar button on sessions
1 parent ebdfb17 commit aebd41b

File tree

17 files changed

+483
-35
lines changed

17 files changed

+483
-35
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"eslint-config-next": "^14.1.0",
1919
"jsonwebtoken": "^9.0.2",
2020
"lucide-react": "^0.469.0",
21+
"moment": "^2.30.1",
2122
"msw": "^2.6.5",
2223
"next": "^14.1.0",
2324
"next-auth": "^4.23.1",
@@ -29,6 +30,7 @@
2930
"react-qr-code": "^2.0.12",
3031
"react-social-icons": "^6.18.0",
3132
"react-use": "^17.6.0",
33+
"sharp": "^0.33.5",
3234
"tailwindcss": "3.3.3",
3335
"typescript": "5.1.6"
3436
},

src/app/(authenticated)/sessions/[id]/check-in/SessionCheckInScanner.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export default function SessionCheckInScanner({
2020
}: SessionCheckInScannerProps) {
2121
const [status, setStatus] = useState({
2222
participantsNumber: sinfoSession.participants?.length || 0,
23-
unauthenticatedParticipantsNumber:
24-
sinfoSession.unauthenticatedParticipants || 0,
23+
unregisteredParticipantsNumber: sinfoSession.unregisteredParticipants || 0,
2524
});
2625
const [topCard, setTopCard] = useState<ReactNode | undefined>();
2726
const [bottomCard, setBottomCard] = useState<ReactNode | undefined>();
@@ -64,8 +63,8 @@ export default function SessionCheckInScanner({
6463
<MessageCard type="danger" content="Invalid QR-Code" />,
6564
);
6665
setStatus({
67-
unauthenticatedParticipantsNumber:
68-
sessionStatus.unauthenticatedParticipantsNumber,
66+
unregisteredParticipantsNumber:
67+
sessionStatus.unregisteredParticipantsNumber,
6968
participantsNumber: sessionStatus.participantsNumber,
7069
});
7170
}
@@ -101,7 +100,7 @@ export default function SessionCheckInScanner({
101100
<span>{status.participantsNumber}</span>
102101
/
103102
<Ghost size={16} />
104-
<span>{status.unauthenticatedParticipantsNumber}</span>
103+
<span>{status.unregisteredParticipantsNumber}</span>
105104
</div>
106105
<button className="button button-primary flex-1">
107106
<UserPlus size={32} strokeWidth={1} />

src/app/(authenticated)/sessions/[id]/page.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import List from "@/components/List";
44
import ListCard from "@/components/ListCard";
55
import MessageCard from "@/components/MessageCard";
66
import { PrizeTile } from "@/components/prize";
7+
import AddToCalendarButton from "@/components/session/AddToCalendarButton";
8+
import { CalendarButton } from "@/components/session/CalendarButton";
79
import { SessionService } from "@/services/SessionService";
810
import { UserService } from "@/services/UserService";
911
import { generateTimeInterval, isMember } from "@/utils/utils";
10-
import { CalendarClock, MapPin, Scan, Users } from "lucide-react";
12+
import { Calendar, CalendarClock, MapPin, Scan, Users } from "lucide-react";
1113
import { getServerSession } from "next-auth";
1214
import Image from "next/image";
1315
import Link from "next/link";
@@ -79,6 +81,15 @@ export default async function Session({ params }: { params: SessionParams }) {
7981
</Link>
8082
</div>
8183
)}
84+
<div className="flex justify-center items-center p-4 gap-2">
85+
<AddToCalendarButton
86+
name={`[SINFO 32] - ${sinfoSession.name} (${sinfoSession.kind})`}
87+
startDate={sinfoSession.date}
88+
duration={sinfoSession.duration}
89+
location={sinfoSession.place}
90+
description={sinfoSession.description}
91+
/>
92+
</div>
8293
{/* ExtraInformation */}
8394
{sinfoSession.extraInformation?.length ? (
8495
<List title="Information">

src/app/(authenticated)/speakers/SpeakersList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function SpeakersList({ speakers }: SpeakersListProps) {
2121
speakers.filter(
2222
(speaker) =>
2323
speaker.name.toLowerCase().includes(text.toLowerCase()) ||
24-
speaker.company?.name.toLowerCase().includes(text.toLowerCase()),
24+
speaker.company?.name?.toLowerCase().includes(text.toLowerCase()),
2525
),
2626
);
2727
}
Lines changed: 60 additions & 0 deletions
Loading
Lines changed: 44 additions & 0 deletions
Loading

src/assets/icons/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ export { default as googleIcon } from "./google.png";
22
export { default as istIcon } from "./ist.png";
33
export { default as linkedinIcon } from "./linkedin.png";
44
export { default as microsoftIcon } from "./microsoft.png";
5+
export { default as googleCalendarIcon } from "./google-calendar.svg";
6+
export { default as appleCalendarIcon } from "./apple-calendar.svg";

src/components/GridCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default function GridCard({
2424
}: GridCardProps) {
2525
return (
2626
<Link href={link || "#"} {...linkProps}>
27-
<div className="w-[160px] min-h-[220px] flex flex-col items-center justify-between px-4 py-4 gap-y-2 text-sm bg-white rounded-md shadow-md text-center overflow-hidden hover:bg-slate-50 hover:shadow-sm active:bg-gray-200 active:shadow-none">
27+
<div className="w-[160px] min-h-[240px] flex flex-col items-center justify-between px-4 py-4 gap-y-2 text-sm bg-white rounded-md shadow-md text-center overflow-hidden hover:bg-slate-50 hover:shadow-sm active:bg-gray-200 active:shadow-none">
2828
{/* TODO: Fix large names! Truncate is not working */}
29-
<span title={title} className="truncate">
29+
<span title={title} className="h-12 w-full line-clamp-2">
3030
{title}
3131
</span>
3232
<Image

src/components/List.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link, { LinkProps } from "next/link";
22

33
export interface ListProps {
4+
id?: string;
45
title?: string;
56
description?: string;
67
link?: string;
@@ -13,6 +14,7 @@ export interface ListProps {
1314
}
1415

1516
export default function List({
17+
id,
1618
title,
1719
description,
1820
link,
@@ -24,7 +26,7 @@ export default function List({
2426
children,
2527
}: ListProps) {
2628
return (
27-
<div className="flex flex-col gap-y-2 p-4">
29+
<div className="flex flex-col gap-y-2 p-4" id={id}>
2830
<div className="flex justify-between items-center">
2931
<div className="flex flex-col">
3032
{title && <span className="text-lg font-bold">{title}</span>}

src/components/SocialNetwork.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { SocialIcon } from "react-social-icons";
22

3-
type SocialNetworkType = "linkedin" | "email" | "github" | "website";
3+
type SocialNetworkType =
4+
| "linkedin"
5+
| "linkedinCompany"
6+
| "email"
7+
| "github"
8+
| "website";
49

510
interface SocialNetworkProps {
611
text: string;
@@ -9,6 +14,7 @@ interface SocialNetworkProps {
914

1015
const baseHref: Record<SocialNetworkType, string> = {
1116
linkedin: "https://linkedin.com/in/",
17+
linkedinCompany: "https://linkdein.com/company/",
1218
email: "mailto:",
1319
github: "https://github.com/",
1420
website: "",

0 commit comments

Comments
 (0)