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

Production 2024-03-19_00 #125

Merged
merged 5 commits into from
Mar 19, 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
4 changes: 2 additions & 2 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ export default function AboutPage() {
{COMMITTEE_MEMBERS.map((member, index) => (
<FancyRectangle
key={index}
colour={member.isExecCommittee ? 'yellow' : 'white'}
colour={member.exec ? 'yellow' : 'white'}
offset={'8'}
filled
rounded
fullWidth
fullHeight
>
<div
className={`h-full w-full rounded-xl border-2 border-${member.isExecCommittee ? 'yellow' : 'white'} flex flex-col justify-center bg-grey p-4`}
className={`h-full w-full rounded-xl border-2 ${member.exec ? 'border-yellow' : 'border-white'} flex flex-col justify-center bg-grey p-4`}
>
<h3 className="text-2xl font-bold">{member.name}</h3>
<p>{member.position}</p>
Expand Down
7 changes: 0 additions & 7 deletions src/app/api/member/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { db } from '@/db';
import { memberTable } from '@/db/schema';
import { checkUserExists } from '@/server/check-user-exists';
import { currentUser } from '@clerk/nextjs';
import { createInsertSchema } from 'drizzle-zod';
import { z } from 'zod';
Expand All @@ -22,12 +21,6 @@ export async function POST(request: Request) {
return new Response(JSON.stringify(reqBody.error.format()), { status: 400 });
}

// Avoid duplicate users in database
const userExists = await checkUserExists(user.id);
if (userExists) {
return new Response(null, { status: 403 });
}

await db.insert(memberTable).values({
clerkId: user.id,
email: user.emailAddresses[0].emailAddress,
Expand Down
94 changes: 46 additions & 48 deletions src/data/committee-members.ts
Original file line number Diff line number Diff line change
@@ -1,125 +1,123 @@
type CommitteeMember = {
name: string;
position: string;
isExecCommittee: boolean;
exec?: boolean;
};

// List of committee members with name, role and whether they are part of the
// executive committee
export const COMMITTEE_MEMBERS = [
export const COMMITTEE_MEMBERS: CommitteeMember[] = [
{
name: 'David Maslov',
position: 'President',
isExecCommittee: true,
exec: true,
},
{
name: 'Cubie',
position: 'Vice-President',
isExecCommittee: true,
exec: true,
},
{
name: 'Christian',
position: 'Treasurer',
isExecCommittee: true,
exec: true,
},
{
name: 'Ray Okamoto',
position: 'Secretary',
isExecCommittee: true,
exec: true,
},
{
name: 'Milan',
position: 'Partnerships & Sponsorships Manager',
isExecCommittee: true,
exec: true,
},
{
name: 'F. Umar',
position: 'Partnerships & Sponsorships Officer',
isExecCommittee: false,
},
{
name: 'Pouya',
position: 'Partnerships & Sponsorships Officer',
isExecCommittee: false,
},
{
name: 'Bowen Sun',
position: 'Business Manager',
isExecCommittee: false,
},
{
name: 'Willard Gorman',
position: 'Duck Lounge Liaison',
isExecCommittee: false,
},
{
name: 'Mischa Sarac',
position: 'Equity Officer',
isExecCommittee: false,
},
{
name: 'S. Bhatta',
position: 'Artificial Intelligence Representative',
isExecCommittee: false,
name: 'Maged Gayed',
position: 'First Year Representative',
},
{
name: 'Will Johnston',
position: 'Cybersecurity Representative',
isExecCommittee: false,
name: 'Yuhan Wang',
position: 'Graphic Designer',
},
{
name: 'Khanh',
position: 'Data Science Representative',
isExecCommittee: false,
name: 'M. Klaric',
position: 'Graphic Designer',
},
{
name: 'Jonty Leslie',
position: 'Distributed Systems & Networking Representative',
isExecCommittee: false,
name: 'Darcy',
position: 'Social Media Officer',
},
{
name: 'Joshua Goldsworthy Callaway',
position: 'Information Technology Representative',
isExecCommittee: false,
name: 'Yaman Ashqar',
position: 'Social Media Officer',
},
{
name: 'Dino Macri',
position: 'Software Engineering Representative',
isExecCommittee: false,
name: 'Omar Badr',
position: 'Social Media Officer',
},
{
name: 'Yuhan Wang',
position: 'Graphic Designer',
isExecCommittee: false,
name: 'Phoenix Pereira',
position: 'Open Source Officer',
},
{
name: 'Darcy',
position: 'Social Media Officer',
isExecCommittee: false,
name: 'Yeyang (Justin) Sun',
position: 'Open Source Officer',
},
{
name: 'M. Klaric',
position: 'Social Media Officer',
isExecCommittee: false,
name: 'S. Bhatta',
position: 'General Committee',
},
{
name: 'Phoenix Pereira',
position: 'Open Source Officer',
isExecCommittee: false,
name: 'Will Johnston',
position: 'General Committee',
},
{
name: 'Rishi Adhikari',
position: 'Open Source Officer',
isExecCommittee: false,
name: 'Khanh',
position: 'General Committee',
},
{
name: 'Jonty Leslie',
position: 'General Committee',
},
{
name: 'Cuinn Kemp',
position: 'General Committee',
isExecCommittee: false,
},
{
name: 'Timothy Choi',
position: 'General Committee',
isExecCommittee: false,
},
] as const satisfies CommitteeMember[];
{
name: 'Leo Li',
position: 'General Committee',
},
{
name: 'Zachary Anderson',
position: 'General Committee',
},
{
name: 'Mansi Patel',
position: 'General Committee',
},
];
34 changes: 17 additions & 17 deletions src/data/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export const EVENTS: Event[] = [
// 'Unsure of what jobs are available in the tech industry? Or looking to find out more about where your expertise could take you? If so, come along and gain insights into what a career in the industry might look like.',
// image: 'insight-into-industry.jpg',
// },
{
title: 'Quiz Night',
date: { month: 'MAR', day: 8 },
time: '6:00pm - 9:00pm',
location: 'Ingkarni Wardli 218',
details: 'Join us for a night of quizzical encounters! Free food and prizes to come!',
image: 'quiz-night.jpg',
},
// {
// title: 'Quiz Night',
// date: { month: 'MAR', day: 8 },
// time: '6:00pm - 9:00pm',
// location: 'Ingkarni Wardli 218',
// details: 'Join us for a night of quizzical encounters! Free food and prizes to come!',
// image: 'quiz-night.jpg',
// },
{
title: 'Industry Night',
date: { month: 'APR', day: 2 },
Expand All @@ -57,15 +57,15 @@ export const EVENTS: Event[] = [
details: 'Connect with top companies and explore job opportunities in the tech industry!',
image: 'industry-night.jpg',
},
{
title: 'LaTeX Workshop',
date: { month: 'APR', day: 4 },
time: '5:00pm - 7:00pm',
location: 'Ingkarni Wardli 218',
details:
'Do you want to create pretty documents? Is Word destroying your assignments when you move images around? Look no further than LaTeX, the academic typesetting tool created by the great Donald Knuth, and the solution to all your maths assignments.',
image: 'latex-workshop.jpg',
},
// {
// title: 'LaTeX Workshop',
// date: { month: 'APR', day: 4 },
// time: '5:00pm - 7:00pm',
// location: 'Ingkarni Wardli 218',
// details:
// 'Do you want to create pretty documents? Is Word destroying your assignments when you move images around? Look no further than LaTeX, the academic typesetting tool created by the great Donald Knuth, and the solution to all your maths assignments.',
// image: 'latex-workshop.jpg',
// },
];

export const CAROUSEL_IMAGES: Image[] = [
Expand Down
2 changes: 1 addition & 1 deletion src/data/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
export const LINKS = [
{ name: 'Email', link: 'mailto:[email protected]', icon: FaEnvelope },
{ name: 'GitHub', link: 'https://github.com/compsci-adl', icon: FaGithub },
{ name: 'Instagram', link: 'https://www.instagram.com/compsci.adl/', icon: FaInstagram },
{ name: 'Instagram', link: 'https://www.instagram.com/csclub.adl/', icon: FaInstagram },
{ name: 'Facebook', link: 'https://www.facebook.com/compsci.adl/', icon: FaFacebook },
{ name: 'Discord', link: 'https://discord.gg/UjvVxHA', icon: FaDiscord },
{ name: 'LinkedIn', link: 'https://www.linkedin.com/company/compsci-adl/', icon: FaLinkedin },
Expand Down
2 changes: 1 addition & 1 deletion src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const memberTable = sqliteTable('members', {
.$defaultFn(() => nanoid())
.primaryKey(),

clerkId: text('clerk_id').notNull(),
clerkId: text('clerk_id').notNull().unique(),
email: text('email').notNull(),
firstName: text('first_name').notNull(),
lastName: text('last_name').notNull(),
Expand Down
Loading