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

Added registration button and on-spot registration events #54

Merged
merged 6 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion src/app/(content)/events/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function EventsPage() {
{cards
.sort((a, b) => a.name.localeCompare(b.name))
.map((card, index) => {
if (card.id === "5") {
if (card.id === "50") {
return null;
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/(content)/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function EventsPage() {
<div className="py-4 mx-6 sm:mx-12 space-y-4 mt-10 pt-10">
<h1
id="about"
className={cn("text-center text-4xl", tiaraFont.className)}
className={cn("text-center text-4xl text-white", tiaraFont.className)}
>
Events categories
</h1>
Expand Down
12 changes: 7 additions & 5 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";
import { HeroParallax } from "@/components/widgets/Hero";
import { LabIntro } from "@/components/story/intro";
import { Last } from "@/components/story/last";
"use client";;
import Lenis from "@/components/shared/lenis";
import { LabIntro } from "@/components/story/intro";
import { HeroParallax } from "@/components/widgets/Hero";
import { tiaraAssetsPrefix } from "@/lib/utils";
import RegisterNow from "../components/ui/registernow";
import EventsPage from "./(content)/events/page";

const images = [
{ alt: "Image 0", src: `${tiaraAssetsPrefix}/hero/3(1).avif` },
Expand All @@ -30,7 +31,8 @@ export default function Home() {
<Lenis>
<HeroParallax images={images} />
<LabIntro />
<Last />
<EventsPage />
<RegisterNow />
</Lenis>
</main>
);
Expand Down
19 changes: 2 additions & 17 deletions src/app/register/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { TabsDemo } from "@/components/razorpay/perCategory";
import { EventTabs } from "@/components/razorpay/perCategory";
import {
Card,
CardDescription,
Expand Down Expand Up @@ -250,25 +250,10 @@ const Register: React.FC = () => {
disabled
/>
<br />

{/* {hasTeams && (
<>
<Label htmlFor="team_name">Team Name</Label>
<Input
type="text"
id="team_name"
aria-label="Team Name"
placeholder="Enter your team name"
value={teamName}
required
onChange={(e) => setTeamName(e.target.value)}
/>
</>
)} */}
</div>
<Separator className="my-2" />
<div className="flex justify-between flex-col lg:flex-row">
<TabsDemo
<EventTabs
{...{ technical, nontechnical, cultural, mega }}
technicalCheckedItems={technicalCheckedItems}
nontechnicalCheckedItems={nontechnicalCheckedItems}
Expand Down
41 changes: 22 additions & 19 deletions src/components/razorpay/perCategory.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Input } from "../ui/input";
import Info from "../ui/hover/info";

interface Event {
name: string;
Expand Down Expand Up @@ -43,7 +39,7 @@ const Checkbox: React.FC<CheckboxProps> = ({
);
};

export function TabsDemo({
export function EventTabs({
technical,
nontechnical,
cultural,
Expand Down Expand Up @@ -98,7 +94,7 @@ export function TabsDemo({
>
<Label className="mr-2">{event.name}</Label>
<Checkbox
className="w-6 h-6 bg-zinc-800"
className="w-6 h-6 mr-2"
value={event.key}
checked={technicalCheckedItems.some(
(item) => item.key === event.key
Expand All @@ -116,21 +112,28 @@ export function TabsDemo({
<CardHeader>
<CardTitle>Choose a Non Technical Events</CardTitle>
</CardHeader>

<CardContent className="space-y-2">
{nontechnical.map((event) => (
<div
key={event.key}
className="flex justify-between items-center p-4 mb-2"
>
<Label className="mr-2">{event.name}</Label>
<Checkbox
className="w-6 h-6"
value={event.key}
checked={nontechnicalCheckedItems.some(
(item) => item.key === event.key
)}
onChange={(e) => handleCheckboxChange(e, "nontechnical")}
/>
{parseInt(event.key) < 14 ? (
<Checkbox
className="w-6 h-6 mr-2"
value={event.key}
checked={nontechnicalCheckedItems.some(
(item) => item.key === event.key
)}
onChange={(e) => handleCheckboxChange(e, "nontechnical")}
/>
) : (
<div className="ml-36">
<Info info={"Registration is not available online but will be available offline on the day of Tiara."} />
</div>
)}
</div>
))}
</CardContent>
Expand All @@ -142,15 +145,15 @@ export function TabsDemo({
<CardHeader>
<CardTitle>Choose a Cultural Events</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<CardContent className="space-y-2 ">
{cultural.map((event) => (
<div
key={event.key}
className="flex justify-between items-center p-4 mb-2"
>
<Label className="mr-2">{event.name}</Label>
<Checkbox
className="w-6 h-6"
className="w-6 h-6 mr-2"
value={event.key}
checked={culturalCheckedItems.some(
(item) => item.key === event.key
Expand All @@ -176,7 +179,7 @@ export function TabsDemo({
>
<Label className="mr-2">{event.name}</Label>
<Checkbox
className="w-6 h-6"
className="w-6 h-6 mr-2"
value={event.key}
checked={megaCheckedItems.some(
(item) => item.key === event.key
Expand Down
5 changes: 2 additions & 3 deletions src/components/story/last/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Scrollytelling from "@bsmnt/scrollytelling";
import s from "./last.module.scss";
import { cn } from "@/lib/utils";
import { tiaraFont } from "@/lib/fonts";
import { Button } from "@/components/ui/button";

export const Last = () => {
return (
Expand Down Expand Up @@ -47,9 +48,7 @@ export const Last = () => {
<h2
className={cn(s["title"], "tracking-widest", tiaraFont.className)}
>
Ti<span className="text-tiara_red">ar</span>a registrations{" "}
<br />
out now!
<Button className="">Register Now</Button>
</h2>
</Scrollytelling.Animation>
</div>
Expand Down
20 changes: 9 additions & 11 deletions src/components/ui/checkout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import { Card, CardContent } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
import { Suspense, use } from "react";
import React from "react";
import { useSession } from "next-auth/react";
import { CheckedItem, Teams } from "@/lib/interfaces";
import RenderCheckedItemsList from "./renderCheckedItemList";
import { useState, useEffect } from "react";
import Loading from "@/app/loading";
import { Text } from "../shared/text";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { Card, CardContent } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
import { CheckedItem, Teams } from "@/lib/interfaces";
import { useSession } from "next-auth/react";
import Link from "next/link";
import React, { Suspense, useEffect, useState } from "react";
import { Text } from "../shared/text";
import Info from "./hover/info";
import { Label } from "./label";
import { Input } from "./input";
import Link from "next/link";
import { Label } from "./label";
import RenderCheckedItemsList from "./renderCheckedItemList";

const Buy = React.lazy(() => import("@/components/razorpay/Buy"));

Expand Down
22 changes: 22 additions & 0 deletions src/components/ui/registernow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from "next/link";
import React from "react";
import { Button } from "./button";
import { cn } from "@/lib/utils";
import { tiaraFont } from "@/lib/fonts";

export default function RegisterNow() {
return (
<div className="flex items-center justify-center my-8">
<Link href="/register">
<Button
className={cn(
"w-full max-w-sm rounded text-xl bg-tiara_red text-white hover:bg-red-600 transition-all ease-in-out hover:scale-125 hover:delay-150",
tiaraFont.className
)}
>
register now
</Button>
</Link>
</div>
);
}
90 changes: 45 additions & 45 deletions src/data/categoryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,50 +1062,50 @@ const categoriesList = {
},
],
},
// "14": {
// team: false,
// name: "Seasoned-saute (ONLY FOR FACULTIES)",
// description: "",
// rules: ["RR"],
// prerequisites: ["PP"],
// costs: 1,
// thumbnail: "",
// startTime: "2024-05-12 10:00",
// endTime: "2024-05-12 18:00",
// facultyCoordinators: [
// {
// name: "Michael Johnson",
// phone: "+1122334455",
// },
// ],
// studentCoordinators: [
// {
// name: "Emily Brown",
// phone: "+5566778899",
// },
// ],
// },
// "14": {
// name: ". Seasoned-saute (ONLY FOR FACULTIES)",
// description: "",
// rules: ["RR"],
// prerequisites: ["PP"],
// thumbnail: "/codejam-thumbnail.jpg",
// startTime: "2024-05-12 10:00",
// endTime: "2024-05-12 18:00",
// facultyCoordinators: [
// {
// name: "Michael Johnson",
// phone: "+1122334455",
// },
// ],
// studentCoordinators: [
// {
// name: "Emily Brown",
// phone: "+5566778899",
// },
// ],
// },
"14": {
team: false,
name: "Buzz Wire",
description: "",
rules: ["RR"],
prerequisites: ["PP"],
costs: 1,
thumbnail: `${tiaraAssetsPrefix}/nontechnical/buzzwire.avif`,
startTime: "2024-05-12 10:00",
endTime: "2024-05-12 18:00",
facultyCoordinators: [
{
name: "Michael Johnson",
phone: "+1122334455",
},
],
studentCoordinators: [
{
name: "Emily Brown",
phone: "+5566778899",
},
],
},
"15": {
name: "Aim The Target",
description: "",
rules: ["RR"],
prerequisites: ["PP"],
thumbnail: `${tiaraAssetsPrefix}/nontechnical/aimthetarget.avif`,
startTime: "2024-05-12 10:00",
endTime: "2024-05-12 18:00",
facultyCoordinators: [
{
name: "Michael Johnson",
phone: "+1122334455",
},
],
studentCoordinators: [
{
name: "Emily Brown",
phone: "+5566778899",
},
],
},
},
],
},
Expand Down Expand Up @@ -1421,7 +1421,7 @@ const categoriesList = {
},
],
},
"5": {
"50": {
name: "Tech Titan Tussle (Robo War, 8KG)",
description:
"Witness sparks fly and metal clash in the ultimate showdown of robotic combat",
Expand Down
Loading