Skip to content

Made the Contacts into its own section #250

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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: 2 additions & 0 deletions src/app/directory/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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 OrgContactLinks from '@src/components/OrgContactLinks';
import { api } from '@src/trpc/server';
import { db } from '@src/server/db';
import { eq } from 'drizzle-orm';
Expand All @@ -18,6 +19,7 @@ const OrganizationPage = async ({ params }: { params: { id: string } }) => {
<div className="mb-5 flex flex-col space-y-4 px-3">
<OrgHeader club={club} />
<OrgInfoSegment club={club} />
<OrgContactLinks club={club} />
<OrgUpcomingEvents clubId={club.id} />
</div>
</main>
Expand Down
55 changes: 55 additions & 0 deletions src/components/OrgContactLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Image from 'next/image';
import ContactButtons from './ContactButtons';
import type {
SelectClub,
SelectContact as Contacts,
} from '@src/server/db/models';
import JoinButton from './JoinButton';
import { getServerAuthSession } from '@src/server/auth';
import Link from 'next/link';
import { api } from '@src/trpc/server';

type Club = SelectClub & {
contacts?: Contacts[];
tags: string[];
};
const OrgContactLinks = async ({ club }: { club: Club }) => {
const session = await getServerAuthSession();
const memberType = await api.club.memberType({ id: club.id });
return (
<div className="relative">
<div className="h-full w-full">
<Image
src={'/images/wideWave.jpg'}
alt="Picture of the club"
style={{
width: '100%',
height: 'auto',
}}
height={150}
width={450}
className="rounded-lg object-cover"
priority
/>
</div>
<div className="absolute left-0 top-0 h-full w-full">
<div className="flex h-full w-full p-8 flex-row">
<div className="flex h-full flex-col justify-center">
<h1
className={`w-fit rounded-full bg-black bg-opacity-50 p-2 text-center font-bold text-slate-100 ${
club.name.length > 10 ? 'text-2xl' : 'text-4xl'
}`}
>
{"Contacts"}
</h1>
</div>
<div className="ml-auto flex h-min flex-row items-center gap-x-12 self-center">
<ContactButtons contacts={club.contacts || []} />
</div>
</div>
</div>
</div>
);
};

export default OrgContactLinks;
1 change: 0 additions & 1 deletion src/components/OrgHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ const OrgHeader = async ({ club }: { club: Club }) => {
/>
</>
)}
<ContactButtons contacts={club.contacts || []} />
</div>
</div>
</div>
Expand Down