Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
sirAvent committed Nov 2, 2023
1 parent 157608e commit 2ba6222
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 64 deletions.
114 changes: 51 additions & 63 deletions src/components/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ export default function EventsSection() {
Schedule
</div>

{/* <div className="flex text-xl md:text-2xl lg:text-3xl">
Our full itinerary of Events and Workshops will be available soon!
</div> */}

{sortedSchedule.map((date) => (
<div
className="mb-2 flex flex-col md:mb-6 lg:gap-6"
Expand All @@ -62,72 +58,64 @@ export default function EventsSection() {
{getFormattedDate(date[0].date)}
</div>

{date
.sort((a, b) => {
const timeA =
parseInt(a.time, 10) + (a.time.includes("PM") ? 12 : 0);
const timeB =
parseInt(b.time, 10) + (b.time.includes("PM") ? 12 : 0);
return timeA - timeB;
})
.map((event) => (
<div
className="flex w-[100%] flex-col lg:flex-row lg:items-center lg:justify-between lg:gap-0"
key={event.title + event.time}
>
<div className="mb-6 flex items-start gap-6 align-top lg:h-[100%]">
<div className="hidden h-32 w-32 items-center md:flex">
<img
src={event.logo}
alt="Club Logo"
className="flex items-center rounded-2xl"
/>
</div>
{date.map((event) => (
<div
className="flex w-[100%] flex-col lg:flex-row lg:items-center lg:justify-between lg:gap-0"
key={event.title + event.time}
>
<div className="mb-6 flex items-start gap-6 align-top lg:h-[100%]">
<div className="hidden h-32 w-32 items-center md:flex">
<img
src={event.logo}
alt="Club Logo"
className="flex items-center rounded-2xl"
/>
</div>

<div className="flex flex-col gap-4">
<div>
<div className="flex text-3xl md:w-[28rem] md:text-4xl lg:w-[20rem] xl:w-[28rem]">
{event.title}
</div>
<div className="text-lg md:text-xl">
{`${event.time}${event.club && event.club + " • " } ${event.location}`}
</div>
<div className="flex flex-col gap-4">
<div>
<div className="flex text-3xl md:w-[28rem] md:text-4xl lg:w-[20rem] xl:w-[28rem]">
{event.title}
</div>
<div className="text-lg md:text-xl">
{`${event.time}${event.club && event.club + " • " } ${event.location}`}
</div>
</div>

<div className="flex gap-2 md:gap-4">
{event.rsvp && (
<a href={event.rsvp} target="_blank" className="flex">
<div className="flex h-10 place-content-center items-center gap-2 rounded-full bg-green-700 px-4 text-xl text-slate-100 drop-shadow-lg">
RSVP
<span className="md: visible hidden">
<FaExternalLinkAlt />
</span>
</div>
</a>
)}
<div className="flex gap-2 md:gap-4">
{event.rsvp && (
<a href={event.rsvp} target="_blank" className="flex">
<div className="flex h-10 place-content-center items-center gap-2 rounded-full bg-green-700 px-4 text-xl text-slate-100 drop-shadow-lg">
RSVP
<span className="md: visible hidden">
<FaExternalLinkAlt />
</span>
</div>
</a>
)}

{event.recording && (
<a
href={event.recording}
target="_blank"
className="flex"
>
<div className="flex h-10 place-content-center items-center gap-2 rounded-full bg-gray-600 px-4 text-xl text-slate-100 drop-shadow-lg">
Recording
<span>
<FaExternalLinkAlt />
</span>
</div>
</a>
)}
</div>
{event.recording && (
<a
href={event.recording}
target="_blank"
className="flex"
>
<div className="flex h-10 place-content-center items-center gap-2 rounded-full bg-gray-600 px-4 text-xl text-slate-100 drop-shadow-lg">
Recording
<span>
<FaExternalLinkAlt />
</span>
</div>
</a>
)}
</div>
</div>
<div className="overflow-y-auto text-lg md:text-xl lg:min-h-[8rem] lg:w-[40%]">
{event.desc}
</div>
</div>
))}
<div className="overflow-y-auto text-lg md:text-xl lg:min-h-[8rem] lg:w-[40%]">
{event.desc}
</div>
</div>
))}
</div>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function MyApp({ Component, pageProps }) {
return (
<>
<Head>
<meta charset="UTF-8" />
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="WebJam is a beginner friendly, week-long event where students come together to create fully functional web applications. Apply now!" />
<meta name="keywords" content="beginner-friendly, hackathon, web applications" />
Expand Down

0 comments on commit 2ba6222

Please sign in to comment.