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

Made the Contacts into its own section #250

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
Binary file added public/images/lightBlueBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/lightBlueBG.png'}
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 p-2 text-center font-bold text-customBlue ${
club.name.length > 10 ? 'text-2xl' : 'text-4xl'
}`}
>
{"Contact Information"}
</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;
7 changes: 3 additions & 4 deletions src/components/OrgHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ const OrgHeader = async ({ club }: { club: Club }) => {
query: { tag: tag },
}}
key={tag}
className="m-2 h-min rounded-full bg-black bg-opacity-50 px-4 py-2 align-middle font-semibold text-slate-100"
className="m-2 h-min rounded-full px-4 py-2 align-middle font-semibold text-slate-100 text-1xl"
>
{tag}
</Link>
))}
</div>
<h1
className={`mt-auto 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'
className={`mt-auto w-fit rounded-full p-2 text-center font-bold text-slate-100 ${
club.name.length > 10 ? 'text-5xl' : 'text-10xl'
}`}
>
{club.name}
Expand All @@ -75,7 +75,6 @@ const OrgHeader = async ({ club }: { club: Club }) => {
/>
</>
)}
<ContactButtons contacts={club.contacts || []} />
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const config = {
blue: {
primary: '#3361FF',
},
customBlue: '#4A72FE',
},
backgroundColor: {
events: '#FF6633',
Expand Down