-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Link uploaded forms to quests (#226)
- Loading branch information
Showing
11 changed files
with
184 additions
and
48 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,5 @@ | ||
--- | ||
"namesake": minor | ||
--- | ||
|
||
Link uploaded forms to quests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { CircleArrowDown } from "lucide-react"; | ||
import { Link } from "../Link"; | ||
import { Tooltip, TooltipTrigger } from "../Tooltip"; | ||
|
||
export type DocumentCardProps = { | ||
title: string; | ||
formCode?: string; | ||
downloadUrl?: string; | ||
}; | ||
|
||
export const DocumentCard = ({ | ||
title, | ||
formCode, | ||
downloadUrl, | ||
}: DocumentCardProps) => { | ||
const fileTitle = formCode ? `${formCode} ${title}` : title; | ||
|
||
return ( | ||
<div className="flex flex-col w-48 h-60 shrink-0 p-4 bg-gray-1 dark:bg-graydark-3 shadow-md rounded"> | ||
{formCode && <p className="text-gray-dim text-sm mb-1">{formCode}</p>} | ||
<header className="font-medium text-pretty leading-tight">{title}</header> | ||
<div className="mt-auto -mb-2 -mr-2 flex justify-end"> | ||
{downloadUrl && ( | ||
<TooltipTrigger> | ||
<Link | ||
href={downloadUrl} | ||
button={{ variant: "icon" }} | ||
aria-label="Download" | ||
className="mt-auto self-end" | ||
download={fileTitle} | ||
> | ||
<CircleArrowDown size={16} className="text-gray-dim" /> | ||
</Link> | ||
<Tooltip>Download</Tooltip> | ||
</TooltipTrigger> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
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 @@ | ||
export * from "./DocumentCard"; |
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