-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various improvements and member document support
- Loading branch information
Showing
32 changed files
with
387 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import getMemberDocuments from "@lib/api/documents/get-member-documents"; | ||
|
||
interface Payload { | ||
params: { | ||
id: string; | ||
page: string; | ||
}; | ||
} | ||
|
||
export async function GET( | ||
_request: Request, | ||
{ params: { id, page } }: Payload, | ||
) { | ||
const pageInt = parseInt(page); | ||
|
||
if (Number.isNaN(pageInt)) { | ||
return new Response("Invalid page", { status: 400 }); | ||
} | ||
|
||
const memberDocuments = await getMemberDocuments({ id, page: pageInt }); | ||
return Response.json(memberDocuments); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { committeeInfo, type Committee } from "@lib/committes"; | ||
import { committeeBackground } from "@lib/styles/committees"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
type CardHeaderProps = React.PropsWithChildren<{ | ||
className?: string; | ||
}>; | ||
|
||
export function CardHeader({ children, className }: CardHeaderProps) { | ||
return ( | ||
<div className={twMerge("w-full px-4 py-1", className)}> | ||
<span>{children}</span> | ||
</div> | ||
); | ||
} | ||
|
||
type CommitteeHeaderProps = { | ||
committee?: Committee | null; | ||
}; | ||
|
||
export function CommitteeHeader({ committee }: CommitteeHeaderProps) { | ||
if (!committee) { | ||
return; | ||
} | ||
const info = committeeInfo[committee]; | ||
return ( | ||
<CardHeader | ||
className={twMerge("text-font-dark", committeeBackground[committee])} | ||
> | ||
{info.desc} | ||
</CardHeader> | ||
); | ||
} | ||
|
||
type BaseCardProps = React.PropsWithChildren< | ||
React.HTMLAttributes<HTMLDivElement> | ||
>; | ||
|
||
export function Card({ children, className = "", ...props }: BaseCardProps) { | ||
return ( | ||
<div | ||
className={twMerge( | ||
"overflow-hidden rounded bg-white p-4 shadow-md", | ||
"dark:bg-background-elevated-dark", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.