Skip to content

Commit

Permalink
Merge branch 'develop' into JUP-76-Make-event-time-client-side
Browse files Browse the repository at this point in the history
  • Loading branch information
nl32 authored Oct 8, 2024
2 parents e66f21a + 62d3430 commit c3508e6
Show file tree
Hide file tree
Showing 81 changed files with 877 additions and 703 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/generateCheck.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
if [ $status == 0 ]; then
echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY
echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY
exit 0
if [ $status == 'success' ]; then
echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY
echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY
exit 0
else
echo "## Formatting Check Failed 😅" >>$GITHUB_STEP_SUMMARY
echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY
echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY
for file in $files; do
echo "- $file" >>$GITHUB_STEP_SUMMARY
echo "::error file=$file::$file not formatted correctly"
done
exit 1
echo "## Formatting Check Failed 😅" >>$GITHUB_STEP_SUMMARY
echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY
echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY
for file in $files; do
echo "- $file" >>$GITHUB_STEP_SUMMARY
echo "::error file=$file::$file not formatted correctly"
done
exit 1
fi
14 changes: 7 additions & 7 deletions .github/workflows/prettierCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
node-version: 18
cache: 'npm'
- name: Run npm install
run: |
mv package.json package.json.bak
npm i --no-save prettier prettier-plugin-tailwindcss
mv package.json.bak package.json
run: npm ci
- name: Run prettier
id: prettier
continue-on-error: true
run: |
files=`npx prettier . -l` || st=$? && st=$?
echo status=`echo $st`>>"$GITHUB_ENV"
echo files=`echo $files`>> "$GITHUB_ENV"
files=`npx prettier . -l`
echo files=$files >> "$GITHUB_ENV"
- name: generate errors/summary
run: .github/workflows/generateCheck.sh
env:
status: ${{ steps.prettier.outcome }}
9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

16 changes: 16 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
const config = {
printWidth: 80,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
bracketSameLine: false,
plugins: ['prettier-plugin-tailwindcss'],
};

export default config;
2 changes: 1 addition & 1 deletion src/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Header from '@src/components/BaseHeader';
import Header from '@src/components/header/BaseHeader';
import type { Metadata } from 'next';

export const metadata: Metadata = {
Expand Down
6 changes: 3 additions & 3 deletions src/app/admin/carousel/add/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import AddOrg from '@src/components/admin/AddOrg';
import AddClub from '@src/components/admin/AddClub';

export default function Page() {
return (
<div className="m-5 md:pl-72">
<h1 className="text-center text-4xl font-bold text-black">
Add Orgs to Carousel
Add Clubs to Carousel
</h1>
<AddOrg />
<AddClub />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ApprovedOrg from '@src/components/admin/ApprovedOrg';
import OtherOrgStatus from '@src/components/admin/OtherOrgStatus';
import ApprovedClub from '@src/components/admin/ApprovedClub';
import OtherClubStatus from '@src/components/admin/OtherClubStatus';
import { db } from '@src/server/db';
import { eq } from 'drizzle-orm';
import { notFound } from 'next/navigation';
Expand All @@ -16,9 +16,9 @@ export default async function Page({ params: { id } }: Props) {
<div className="m-5 h-screen md:pl-72">
<h1 className="text-center text-4xl font-bold">{org.name}</h1>
{org.approved === 'approved' ? (
<ApprovedOrg org={org} />
<ApprovedClub club={org} />
) : (
<OtherOrgStatus org={org} />
<OtherClubStatus club={org} />
)}
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/app/admin/orgs/page.tsx → src/app/admin/clubs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import OrgTable from '@src/components/admin/OrgTable';
import ClubTable from '@src/components/admin/ClubTable';
import { api } from '@src/trpc/server';

export default async function Page() {
const clubs = await api.admin.allOrgs();
const clubs = await api.admin.allClubs();
return (
<div className="m-5 md:pl-72">
<OrgTable clubs={clubs} />
<ClubTable clubs={clubs} />
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default function Page() {
</h1>
<div className="flex justify-center gap-x-5 pt-20">
<Link
href="/admin/orgs"
href="/admin/clubs"
className="rounded-md bg-slate-300 px-2 py-1 text-blue-500 transition-colors hover:bg-slate-400 hover:text-blue-600"
>
Manage Orgs
Manage Clubs
</Link>
<Link
href="/admin/users"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/auth/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProviderButton from '@src/components/ProviderButtons';
import ProviderButton from '@src/app/auth/ProviderButtons';
import { getServerAuthSession } from '@src/server/auth';
import { getProviders } from 'next-auth/react';
import { redirect } from 'next/navigation';
Expand Down
2 changes: 1 addition & 1 deletion src/app/community/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Header from '@src/components/BaseHeader';
import Header from '@src/components/header/BaseHeader';
import { getServerAuthSession } from '@src/server/auth';
import { type Metadata } from 'next';
import Image from 'next/image';
Expand Down
18 changes: 9 additions & 9 deletions src/app/directory/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import Header from '@src/components/BaseHeader';
import OrgHeader from '@src/components/OrgHeader';
import OrgInfoSegment from '@src/components/OrgInfoSegment';
import OrgUpcomingEvents from '@src/components/OrgUpcomingEvents';
import Header from '@src/components/header/BaseHeader';
import ClubHeader from '@src/components/club/listing/ClubHeader';
import ClubInfoSegment from '@src/components/club/listing/ClubInfoSegment';
import ClubUpcomingEvents from '@src/components/club/listing/ClubUpcomingEvents';
import { api } from '@src/trpc/server';
import { db } from '@src/server/db';
import { eq } from 'drizzle-orm';
import { type Metadata } from 'next';
import NotFound from '@src/components/NotFound';

const OrganizationPage = async ({ params }: { params: { id: string } }) => {
const ClubPage = async ({ params }: { params: { id: string } }) => {
const club = await api.club.getDirectoryInfo({ id: params.id });
if (!club) return <NotFound elementType="Club" />;

return (
<main className="w-full md:pl-72">
<Header />
<div className="mb-5 flex flex-col space-y-4 px-3">
<OrgHeader club={club} />
<OrgInfoSegment club={club} />
<OrgUpcomingEvents clubId={club.id} />
<ClubHeader club={club} />
<ClubInfoSegment club={club} />
<ClubUpcomingEvents clubId={club.id} />
</div>
</main>
);
};

export default OrganizationPage;
export default ClubPage;

export async function generateMetadata({
params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Website,
Youtube,
type logoProps,
} from './ContactIcons';
} from '@src/icons/ContactIcons';
import {
type Control,
type UseFormRegister,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type FieldErrors,
} from 'react-hook-form';
import { type z } from 'zod';
import { UserSearchBar } from './SearchBar';
import { UserSearchBar } from '@src/components/searchBar/UserSearchBar';

type OfficerSelectorProps = {
control: Control<z.infer<typeof createClubSchema>>;
Expand Down
4 changes: 2 additions & 2 deletions src/app/directory/create/createForm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';
/* eslint-disable @typescript-eslint/no-misused-promises */
import { zodResolver } from '@hookform/resolvers/zod';
import ContactSelector from '@src/components/CreateContactSelector';
import OfficerSelector from '@src/components/OfficerSelector';
import ContactSelector from '@src/app/directory/create/CreateContactSelector';
import OfficerSelector from '@src/app/directory/create/OfficerSelector';
import { api } from '@src/trpc/react';
import { createClubSchema } from '@src/utils/formSchemas';
import { useRouter } from 'next/navigation';
Expand Down
2 changes: 1 addition & 1 deletion src/app/directory/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Header from '@src/components/BaseHeader';
import Header from '@src/components/header/BaseHeader';
import CreateClubForm from './createForm';
import { getServerAuthSession } from '@src/server/auth';
import { redirect } from 'next/navigation';
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/app/event/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventHeader } from '@src/components/BaseHeader';
import { EventHeader } from '@src/components/header/BaseHeader';
import { db } from '@src/server/db';
import { and, eq } from 'drizzle-orm';
import { type Metadata } from 'next';
Expand All @@ -8,7 +8,7 @@ import Image from 'next/image';
import CountdownTimer from './CountdownTimer';
import Link from 'next/link';
import { getServerAuthSession } from '@src/server/auth';
import RegisterButton from '@src/components/RegisterButton';
import RegisterButton from '@src/app/event/[id]/RegisterButton';

type Params = { params: { id: string } };

Expand Down
2 changes: 1 addition & 1 deletion src/app/events/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventHeader } from '@src/components/BaseHeader';
import { EventHeader } from '@src/components/header/BaseHeader';
import { api } from '@src/trpc/server';
import EventView from './eventView';
import { type Metadata } from 'next';
Expand Down
2 changes: 1 addition & 1 deletion src/app/feedback/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Header from '@src/components/BaseHeader';
import Header from '@src/components/header/BaseHeader';
import { type Metadata } from 'next';
import Form from '@src/app/feedback/Form';

Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Inter } from 'next/font/google';
import { headers } from 'next/headers';

import { TRPCReactProvider } from '@src/trpc/react';
import Sidebar from '@src/components/Sidebar';
import Sidebar from '@src/components/nav/Sidebar';
import { type Metadata } from 'next';

import { Analytics } from '@vercel/analytics/react';
Expand Down
6 changes: 3 additions & 3 deletions src/app/manage/[clubId]/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Header from '@src/components/BaseHeader';
import BackButton from '@src/components/BlueBackButton';
import Header from '@src/components/header/BaseHeader';
import { BlueBackButton } from '@src/components/backButton';
import { getServerAuthSession } from '@src/server/auth';
import { api } from '@src/trpc/server';
import { signInRoute } from '@src/utils/redirect';
Expand Down Expand Up @@ -30,7 +30,7 @@ const Layout = async ({
<Header />
<main className="px-5">
<div className="flex w-full flex-row gap-x-4 align-middle">
<BackButton />
<BlueBackButton />
<h1 className="bg-gradient-to-br from-blue-primary to-blue-700 bg-clip-text text-2xl font-extrabold text-transparent">
{club.name}
</h1>
Expand Down
Loading

0 comments on commit c3508e6

Please sign in to comment.