Skip to content

Commit

Permalink
Merge pull request #234 from privacy-scaling-explorations/devcon-7
Browse files Browse the repository at this point in the history
devcon 7 page
  • Loading branch information
kalidiagne authored Nov 9, 2024
2 parents b6caecb + 3fc0e17 commit a065ed9
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 13 deletions.
34 changes: 34 additions & 0 deletions app/[lang]/devcon-7/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from "react"
import { Metadata } from "next"

import { Devcon7Booths } from "./sections/Devcon7Booths"
import { Devcon7Header } from "./sections/Devcon7Header"
import { Devcon7Section } from "./sections/Devcon7Section"

export const metadata: Metadata = {
title: "Devon 7",
description: "PSE x Devcon 7 Southeast Asia",
openGraph: {
images: [
{
url: "/devcon-7-cover.png",
width: 1200,
height: 630,
},
],
},
}

export default async function DevconPage() {
return (
<>
<div className="flex flex-col lg:pb-[120px]">
<Devcon7Header />
<div className="flex flex-col gap-10 lg:gap-14 pt-8 lg:pt-[60px]">
<Devcon7Booths />
<Devcon7Section />
</div>
</div>
</>
)
}
63 changes: 63 additions & 0 deletions app/[lang]/devcon-7/sections/Devcon7Booths.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import Image from "next/image"
import { booths } from "@/data/events/devcon-7"

import { AppContent } from "@/components/ui/app-content"
import { Icons } from "@/components/icons"

export const Devcon7Booths = () => {
return (
<AppContent>
<div className="flex flex-col gap-10 lg:gap-14">
<h2 className="lg:max-w-[700px] mx-auto font-bold text-black text-lg lg:text-[32px] leading-[110%] font-display text-center px-6">
{`We're excited to connect and collaborate on building meaningful tools
with cryptography.`}
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-14">
{booths?.map((booth, index) => {
return (
<div
key={index}
className="lg:grid lg:grid-cols-[1.5fr_1fr] flex flex-col rounded-lg overflow-hidden border border-[rgba(8, 27, 26, 0.15)]"
>
<div className="min-h-[160px] bg-slate-50 relative order-1 lg:order-2 bg-[lightgray 50% / cover no-repeat]">
<Image
src={booth.image}
alt={`booth image ${index + 1}`}
fill
className="object-cover"
priority
/>
</div>
<div className="flex flex-col gap-3 bg-anakiwa-50 p-4 lg:p-7 order-2 lg:order-1">
<span className="text-anakiwa-500 text-xs font-sans leading-5 tracking-[2.5px] uppercase font-bold">
BOOTH
</span>
<span className="text-[22px] leading-[24px] text-tuatara-950 font-display font-bold">
{booth?.title}
</span>
<span className="text-xs lg:text-base lg:leading-6 text-tuatara-950 font-sans font-normal">
{booth?.description}
</span>
<div className="flex flex-col">
<div className="flex items-center gap-[6px]">
<Icons.time className="text-tuatara-500" />
<span className="font-sans text-tuatara-500 text-xs lg:text-sm leading-5 font-normal">
{booth?.date}
</span>
</div>
<div className="flex gap-[6px] items-center">
<Icons.eventLocation className="text-tuatara-500" />
<span className="font-sans text-tuatara-500 text-xs lg:text-sm leading-5 font-normal">
{booth?.location}
</span>
</div>
</div>
</div>
</div>
)
})}
</div>
</div>
</AppContent>
)
}
22 changes: 22 additions & 0 deletions app/[lang]/devcon-7/sections/Devcon7Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Image from "next/image"

export const Devcon7Header = () => {
return (
<div className="relative h-[180px] lg:h-[300px]">
<Image
src="/images/devcon-7-mobile.svg"
alt="Devcon 7 Banner"
fill
className="block object-cover md:hidden"
priority
/>
<Image
src="/images/devcon-7-desktop.svg"
alt="Devcon 7 Banner"
fill
className="hidden object-cover md:block"
priority
/>
</div>
)
}
148 changes: 148 additions & 0 deletions app/[lang]/devcon-7/sections/Devcon7Section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
"use client"

import { useState } from "react"
import Link from "next/link"
import { events } from "@/data/events/devcon-7"
import { cva } from "class-variance-authority"

import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"

const tableSection = cva("lg:grid lg:grid-cols-[200px_1fr_80px_20px] lg:gap-8")
const tableSectionTitle = cva(
"text-anakiwa-500 text-base lg:text-xs font-sans leading-5 tracking-[2.5px] uppercase font-bold lg:pb-3"
)

const EventCard = ({ event = {}, speakers = [], location = "" }: any) => {
const [isOpen, setIsOpen] = useState(false)

return (
<div
className={cn(
"flex flex-col gap-3",
tableSection(),
"py-4 px-6 lg:p-0 lg:pt-[30px] lg:pb-5 border-b border-b-tuatara-200"
)}
>
<div className="flex flex-col gap-1 order-3 lg:order-1">
<span className="text-sm text-tuatara-950 font-bold font-sans leading-5">
{event?.date}
</span>
<div className="grid grid-cols-[1fr_16px] lg:grid-cols-1">
<div className="flex flex-col">
<div className="flex items-center gap-[6px]">
<Icons.time className="text-tuatara-500" />
<span className="font-sans text-tuatara-500 text-xs lg:text-sm leading-5 font-normal">
{event?.time}
</span>
</div>
<div className="flex gap-[6px] items-center">
<Icons.eventLocation className="text-tuatara-500" />
<span className="font-sans text-tuatara-500 text-xs lg:text-sm leading-5 font-normal">
{location}
</span>
</div>
</div>
</div>
</div>
<div className="flex flex-col gap-[10px] lg:order-2 order-2">
<Link
href={event?.url ?? "#"}
target="_blank"
className="text-[22px] leading-[24px] text-tuatara-950 underline font-display hover:text-anakiwa-500 font-bold duration-200"
>
{event?.title}
</Link>
<div
className={cn(
"lg:max-h-none lg:opacity-100 lg:block",
"transition-all duration-300 overflow-hidden",
isOpen ? "max-h-[200px] opacity-100" : "max-h-0 opacity-0",
"lg:transition-none lg:overflow-visible"
)}
>
<span className="text-base leading-6 text-tuatara-950 font-sans font-normal">
{event?.description}
</span>
</div>
</div>

<div className="lg:order-3 order-1 grid gap-5 pb-3 lg:pb-0 grid-cols-[1fr_32px] lg:grid-cols-1">
<div className="flex flex-wrap lg:flex-col gap-1">
{speakers?.map((speaker: any, index: number) => {
return (
<Link
key={index}
className="text-sm text-anakiwa-500 underline break-all"
href={speaker.url ?? "#"}
>
{speaker.label}
</Link>
)
})}
</div>
<button
className="lg:hidden flex"
onClick={() => {
setIsOpen(!isOpen)
}}
>
{isOpen ? (
<Icons.minus
className={cn(
"size-5 ml-auto",
"transition-transform duration-200"
)}
/>
) : (
<Icons.plus
className={cn(
"size-5 ml-auto",
"transition-transform duration-200"
)}
/>
)}
</button>
</div>

<div className="order-4 lg:flex hidden">
<Icons.line />
</div>
</div>
)
}

export const Devcon7Section = () => {
return (
<div className="flex flex-col gap-10 relative lg:px-[60px]">
<div className="flex flex-col lg:container">
<div
className={cn(tableSection(), "lg:border-b lg:border-anakiwa-200")}
>
<div className={cn(tableSectionTitle(), "lg:flex hidden")}>
Details
</div>
<div className={cn(tableSectionTitle(), "lg:text-left text-center")}>
Talks
</div>
<div className={cn(tableSectionTitle(), "lg:flex hidden")}>
Speakers
</div>
<div className="lg:flex hidden"></div>
</div>
<div className="flex flex-col">
{events?.map(({ event, speakers, location }, index) => {
return (
<EventCard
key={index}
event={event}
speakers={speakers}
location={location}
/>
)
})}
</div>
</div>
</div>
)
}
45 changes: 45 additions & 0 deletions components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,52 @@ export type Icon = LucideIcon

export const Icons = {
sun: SunMedium,
time: (props: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="15"
viewBox="0 0 16 15"
fill="none"
{...props}
>
<path
d="M2.51758 7.23497C2.51758 6.21497 2.77258 5.26997 3.27758 4.40497C3.78258 3.53997 4.46758 2.85497 5.33258 2.34997C6.19758 1.84497 7.13758 1.59497 8.15258 1.59497C8.91258 1.59497 9.64258 1.74497 10.3376 2.03997C11.0326 2.33497 11.6276 2.73997 12.1326 3.23997C12.6376 3.73997 13.0376 4.33997 13.3326 5.03997C13.6276 5.73997 13.7776 6.46497 13.7776 7.23497C13.7776 7.99497 13.6276 8.72497 13.3326 9.41997C13.0376 10.115 12.6326 10.715 12.1326 11.215C11.6326 11.715 11.0326 12.115 10.3376 12.41C9.64258 12.705 8.91758 12.855 8.15258 12.855C7.38758 12.855 6.65258 12.705 5.95758 12.41C5.26258 12.115 4.66258 11.71 4.15758 11.21C3.65258 10.71 3.25758 10.11 2.95758 9.41997C2.65758 8.72997 2.51758 7.99997 2.51758 7.23497ZM3.75758 7.23497C3.75758 8.41997 4.18758 9.44997 5.05258 10.325C5.91758 11.19 6.94758 11.62 8.15258 11.62C8.94258 11.62 9.67758 11.425 10.3476 11.03C11.0176 10.635 11.5576 10.105 11.9526 9.42997C12.3476 8.75497 12.5476 8.02497 12.5476 7.23497C12.5476 6.44497 12.3476 5.70997 11.9526 5.03497C11.5576 4.35997 11.0226 3.82497 10.3476 3.42997C9.67258 3.03497 8.94258 2.83997 8.15258 2.83997C7.36258 2.83997 6.62758 3.03497 5.95758 3.42997C5.28758 3.82497 4.74758 4.35997 4.34758 5.03497C3.94758 5.70997 3.75758 6.44497 3.75758 7.23497ZM7.71758 7.23497V3.90497C7.71758 3.78997 7.75758 3.68997 7.83758 3.60997C7.91758 3.52997 8.01758 3.48997 8.13258 3.48997C8.24758 3.48997 8.34758 3.52997 8.42758 3.60997C8.50758 3.68997 8.54758 3.78997 8.54758 3.90497V6.97997L10.3426 8.02497C10.4426 8.08497 10.5026 8.16997 10.5326 8.27997C10.5626 8.38997 10.5476 8.49497 10.4876 8.58997C10.4076 8.72997 10.2876 8.79997 10.1276 8.79997C10.0426 8.79997 9.97258 8.77997 9.91758 8.73997L8.00758 7.62497C7.92258 7.59997 7.85258 7.54997 7.79758 7.47997C7.74258 7.40997 7.71758 7.32997 7.71758 7.23497Z"
fill="currentColor"
/>
</svg>
),
eventLocation: (props: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="15"
viewBox="0 0 16 15"
fill="none"
{...props}
>
<path
d="M8.14844 13.0625L11.2422 9.96876C11.854 9.35689 12.2706 8.57734 12.4394 7.72868C12.6082 6.88003 12.5215 6.00039 12.1904 5.20098C11.8592 4.40158 11.2985 3.71833 10.579 3.23762C9.85956 2.75691 9.01371 2.50033 8.14844 2.50033C7.28317 2.50033 6.43732 2.75691 5.71787 3.23762C4.99841 3.71833 4.43766 4.40158 4.10651 5.20098C3.77536 6.00039 3.6887 6.88003 3.85747 7.72868C4.02625 8.57734 4.44288 9.35689 5.05469 9.96876L8.14844 13.0625ZM8.14844 14.83L4.17094 10.8525C3.38428 10.0658 2.84855 9.06356 2.63152 7.97242C2.41448 6.88128 2.52588 5.75028 2.95162 4.72245C3.37737 3.69462 4.09834 2.81612 5.02336 2.19804C5.94839 1.57996 7.03592 1.25006 8.14844 1.25006C9.26096 1.25006 10.3485 1.57996 11.2735 2.19804C12.1985 2.81612 12.9195 3.69462 13.3453 4.72245C13.771 5.75028 13.8824 6.88128 13.6654 7.97242C13.4483 9.06356 12.9126 10.0658 12.1259 10.8525L8.14844 14.83ZM8.14844 8.12501C8.47996 8.12501 8.7979 7.99332 9.03232 7.7589C9.26674 7.52448 9.39844 7.20653 9.39844 6.87501C9.39844 6.54349 9.26674 6.22555 9.03232 5.99113C8.7979 5.75671 8.47996 5.62501 8.14844 5.62501C7.81692 5.62501 7.49898 5.75671 7.26456 5.99113C7.03014 6.22555 6.89844 6.54349 6.89844 6.87501C6.89844 7.20653 7.03014 7.52448 7.26456 7.7589C7.49898 7.99332 7.81692 8.12501 8.14844 8.12501ZM8.14844 9.37501C7.4854 9.37501 6.84951 9.11162 6.38067 8.64278C5.91183 8.17394 5.64844 7.53805 5.64844 6.87501C5.64844 6.21197 5.91183 5.57609 6.38067 5.10724C6.84951 4.6384 7.4854 4.37501 8.14844 4.37501C8.81148 4.37501 9.44737 4.6384 9.91621 5.10724C10.385 5.57609 10.6484 6.21197 10.6484 6.87501C10.6484 7.53805 10.385 8.17394 9.91621 8.64278C9.44737 9.11162 8.81148 9.37501 8.14844 9.37501Z"
fill="currentColor"
/>
</svg>
),
moon: Moon,
line: (props: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="21"
viewBox="0 0 22 21"
fill="none"
{...props}
>
<path
d="M17.2734 11.3733H5.02344V9.62329H17.2734V11.3733Z"
fill="currentColor"
/>
</svg>
),
twitter: (props: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion components/main-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function MainNav({ items, lang = fallbackLng }: MainNavProps) {
return (
<Link
key={index}
href={item.href}
href={!item?.external ? `/${lang}/${item.href}` : item.href}
target={item.external ? "_blank" : undefined}
className={cn(
"flex cursor-pointer items-center border-b-2 uppercase",
Expand Down
Loading

0 comments on commit a065ed9

Please sign in to comment.