Connect, collaborate, and grow with a community of TypeScript developers
explore-card: difficulty border color on hover, description full-width
Nikita Krupind7feecfbada2
diff --git a/src/components/explore/explore-card.tsx b/src/components/explore/explore-card.tsxindex 0adf60fd..f6eb987d 100644--- a/src/components/explore/explore-card.tsx+++ b/src/components/explore/explore-card.tsx@@ -7,13 +7,22 @@ import { DifficultyBadge } from './difficulty-badge';interface Props {challenge: Awaited<Challenges>[0];}++const BORDERS_BY_DIFFICULTY = {+ BEGINNER: 'hover:border-pink-300',+ EASY: 'hover:border-green-300',+ MEDIUM: 'hover:border-yellow-300',+ HARD: 'hover:border-red-300',+ EXTREME: 'hover:border-orange-300',+};+export function ExploreCard({ challenge }: Props) {return (- <Card>- <CardHeader className="grid grid-cols-[1fr_110px] items-start gap-4 space-y-0">+ <Card className={`duration-300 ${BORDERS_BY_DIFFICULTY[challenge.difficulty]}`}>+ <CardHeader className="grid items-start gap-4 space-y-0"><div className="space-y-1"><CardTitle>{challenge.name}</CardTitle>- <CardDescription className="relative max-h-48 overflow-hidden pb-4">+ <CardDescription className="relative h-48 overflow-hidden pb-4">{/* it didn't like the div */}{/* <divclassName="pointer-events-none absolute inset-0 h-full w-full"diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsxindex 441a7e00..7c466a29 100644--- a/src/components/ui/card.tsx+++ b/src/components/ui/card.tsx@@ -6,7 +6,7 @@ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElemen({ className, ...props }, ref) => (<divref={ref}- className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)}+ className={cn('rounded-3xl border bg-card text-card-foreground shadow-sm', className)}{...props}/>),