-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bandaid for training index being fucked
this is just a port of the changes from protein filled dinner
- Loading branch information
Showing
6 changed files
with
185 additions
and
97 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 |
---|---|---|
@@ -1,44 +1,28 @@ | ||
import ImageGradient from "@/components/training/ImageGradient.tsx"; | ||
import { Link } from "@tanstack/react-router"; | ||
import { cn } from "@/lib/utils"; | ||
import React from "react"; | ||
|
||
interface IndexCardProps { | ||
to?: string; | ||
imageSrc: string; | ||
imageAlt: string; | ||
title: string; | ||
img: React.ReactElement; | ||
title: React.ReactElement; | ||
description: string; | ||
onClick?: () => void; | ||
gradientColor: string; | ||
className?: string; | ||
} | ||
|
||
const IndexCard: React.FC<IndexCardProps> = ({ | ||
to, | ||
imageSrc, | ||
imageAlt, | ||
title, | ||
description, | ||
onClick, | ||
gradientColor, | ||
}) => { | ||
const CardContent = () => ( | ||
<div className="group relative w-full max-w-lg cursor-pointer overflow-hidden rounded-lg shadow-md transition-all duration-300 hover:scale-105 hover:shadow-lg"> | ||
<ImageGradient imageSrc={imageSrc} imageAlt={imageAlt} gradientColor={gradientColor} /> | ||
<div className="absolute bottom-0 left-0 right-0 px-6 pb-14"> | ||
const IndexCard: React.FC<IndexCardProps> = ({ img, title, description, className }) => { | ||
return ( | ||
<div | ||
className={cn( | ||
"group relative w-full max-w-lg cursor-pointer overflow-hidden rounded-lg shadow-md transition-all duration-300 hover:scale-105 hover:shadow-lg", | ||
className, | ||
)} | ||
> | ||
{img} | ||
<div className="absolute bottom-0 left-0 right-0 px-6 pb-12"> | ||
<h3 className="text-xl font-bold text-white">{title}</h3> | ||
<p className="mt-2 text-sm text-gray-300">{description}</p> | ||
<p className="mt-2 text-sm text-gray-200">{description}</p> | ||
</div> | ||
</div> | ||
); | ||
|
||
return to ? ( | ||
<Link to={to}> | ||
<CardContent /> | ||
</Link> | ||
) : ( | ||
<div onClick={onClick} onKeyDown={onClick} role="button" tabIndex={0}> | ||
<CardContent /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default IndexCard; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.