feat(components): Create Event cards#71
Conversation
aleckshen
left a comment
There was a problem hiding this comment.
I think the event card looks great just some changes that need to be addressed and should we good to merge after!
|
|
||
| export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent } | ||
|
|
||
| type EventCardProps = { |
There was a problem hiding this comment.
The domain-specific EventCard should not live inside the shadcn primitive file. ui/ is reserved for generic shadcn primitives — domain components belong in their own folder (matching the Navbar / Footer pattern).
Could you:
- Move the
EventCardPropstype +EventCardfunction (lines 96-150) into a new filesrc/components/EventCard/EventCard.tsx - Change to a named export:
export function EventCard(...) - Re-export from
src/components/index.ts:export { EventCard } from "./EventCard/EventCard" - Leave
ui/card.tsxcontaining only the shadcn primitives (Card,CardHeader, etc.)
This keeps ui/ reusable for any future components that need a generic Card.
| href: string | ||
| } | ||
|
|
||
| function EventCard({ variant, name, date, time, image, href }: EventCardProps) { |
There was a problem hiding this comment.
Three props from the type are accepted but never rendered: description, location, signUpLink. The component destructures only { variant, name, date, time, image, href }.
Issue #58 lists all of these as required for the card — without them the card doesn't actually show the event details. Either render them in the card body (per Figma) or remove them from the type if they're not supposed to be displayed on this card.
| return ( | ||
| <Card | ||
| className={cn( | ||
| "group hover:-translate-y-3 w-90 translate-y-0 gap-0 overflow-hidden rounded-none border-3 bg-transparent p-0 transition-transform duration-500 ease-in-out", |
There was a problem hiding this comment.
border-3 isn't a Tailwind class — Tailwind ships border (1px), border-2, border-4, border-8. This is a silent no-op, so the colored border (border-brand-yellow / border-brand-primary) won't render at the intended 3px width.
Change to border-2 or border-4 depending on what matches Figma. (Same issue exists on the Button PR #70.)
| ) : ( | ||
| <div className="h-full w-full bg-transparent" /> | ||
| )} |
There was a problem hiding this comment.
Missing image fallback is invisible — <div className="h-full w-full bg-transparent" /> renders nothing. AC #3 says "Missing image handled gracefully (placeholder)."
Could you swap this for a visible placeholder, e.g. bg-muted with an icon (lucide-react has ImageIcon), or fall back to the UOAVC logo?
| ) : ( | |
| <div className="h-full w-full bg-transparent" /> | |
| )} | |
| ) : ( | |
| <div className="flex h-full w-full items-center justify-center bg-muted"> | |
| <ImageIcon className="size-12 text-muted-foreground" /> | |
| </div> | |
| )} |
| <div className="h-full w-full bg-transparent" /> | ||
| )} | ||
|
|
||
| <div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-black/0 opacity-0 transition-all duration-300 ease-out group-hover:bg-brand-primary/15 group-hover:opacity-100"> |
There was a problem hiding this comment.
The "learn more" link only appears on hover (group-hover:opacity-100). Keyboard users can't trigger hover, so this link is unreachable via tab navigation — accessibility issue.
Two options:
- Add
group-focus-within:opacity-100 group-focus-within:bg-brand-primary/15to this overlay so the link reveals when the inner button receives focus. - Move the link out of the hover overlay entirely so it's always visible / always in the tab order.
Option 1 is the smaller change.
| )} | ||
|
|
||
| <div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-black/0 opacity-0 transition-all duration-300 ease-out group-hover:bg-brand-primary/15 group-hover:opacity-100"> | ||
| <Button asChild className="pointer-events-auto" variant="default"> |
There was a problem hiding this comment.
variant="default" no longer exists on the Button component once PR #70 lands — the variants are being renamed to primary | secondary | tertiary | cta. This will fail typecheck (or fall back to no styling) after that PR merges.
Update to variant="primary" (or whichever variant matches the Figma button on the card overlay). Worth coordinating with Kyo on which one to use.
Description
Created a reusable event card component that matches the figma design. Hover animation is included with also alt text being the name of the event in case there is an error. Currently the button is not accurate due to not having the required button component completed, therefore this can be implemented after it has been made.
Closes #58
Type of change
How Has This Been Tested?
Checklist before requesting a review