generated from timlrx/tailwind-nextjs-starter-blog
-
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.
Merge pull request #1 from htlabs-xyz/project-page
draft commit
- Loading branch information
Showing
28 changed files
with
203 additions
and
158 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
{ "github": 1, "guide": 1 } | ||
{"github":1,"guide":1} |
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
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,70 @@ | ||
import Image from 'next/image' | ||
import { Project } from '@/.contentlayer/generated' | ||
import { AspectRatio } from '@/components/ui/aspect-ratio' | ||
import { Card } from '@/components/ui/card' | ||
import Link from '@/components/ui/link' | ||
import { cn } from '@/utils' | ||
|
||
export default function ProjectCard({ project }: { project: Project }) { | ||
const { title, slug, description, images, link } = project | ||
const href = link ? link : `/projects/${slug}` | ||
return ( | ||
<Card | ||
className={cn([ | ||
'flex flex-col gap-6 p-4 md:h-80 md:flex-row md:gap-12 md:py-8', | ||
// reversed && 'md:flex-row-reverse', | ||
])} | ||
> | ||
<div className="flex h-full items-center justify-center border-t-slate-600 p-4 sm:h-80 md:h-auto md:w-1/2"> | ||
{images && ( | ||
<AspectRatio ratio={16 / 9} className="bg-muted"> | ||
<Image | ||
src={images[0]} | ||
alt={title} | ||
fill | ||
className="h-full w-full rounded-md object-cover" | ||
/> | ||
</AspectRatio> | ||
)} | ||
</div> | ||
<div className="flex grow flex-col justify-between space-y-6 pb-1 md:w-1/2 md:pb-0"> | ||
<div className="space-y-4"> | ||
<h2 className="text-[1.75rem] font-semibold leading-8"> | ||
{href ? ( | ||
<Link href={href} aria-label={`Link to ${title}`}> | ||
{title} | ||
</Link> | ||
) : ( | ||
title | ||
)} | ||
</h2> | ||
<div className="max-w-none space-y-4"> | ||
{/* <div className="flex flex-wrap items-center gap-2"> | ||
{builtWith?.map((tool) => { | ||
return ( | ||
<Brand | ||
key={tool} | ||
name={tool as keyof typeof BrandsMap} | ||
iconClassName={clsx( | ||
tool === 'Pygame' ? 'h-5 md:h-5.5' : 'h-5 w-5 md:h-5.5 md:w-5.5' | ||
)} | ||
/> | ||
) | ||
})} | ||
</div> */} | ||
<p className="line-clamp-3 text-gray-600 dark:text-gray-400">{description}</p> | ||
</div> | ||
</div> | ||
{href && ( | ||
<Link | ||
href={href} | ||
className="text-base font-medium leading-6 text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" | ||
aria-label={`Link to ${title}`} | ||
> | ||
Show more → | ||
</Link> | ||
)} | ||
</div> | ||
</Card> | ||
) | ||
} |
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 @@ | ||
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio' | ||
|
||
const AspectRatio = AspectRatioPrimitive.Root | ||
|
||
export { AspectRatio } |
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,58 @@ | ||
import * as React from 'react' | ||
|
||
import { cn } from '@/utils' | ||
|
||
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn('bg-card text-card-foreground rounded-lg border shadow-sm', className)} | ||
{...props} | ||
/> | ||
) | ||
) | ||
Card.displayName = 'Card' | ||
|
||
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} /> | ||
) | ||
) | ||
CardHeader.displayName = 'CardHeader' | ||
|
||
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>( | ||
({ className, ...props }, ref) => ( | ||
<h3 | ||
ref={ref} | ||
className={cn('text-2xl font-semibold leading-none tracking-tight', className)} | ||
{...props} | ||
> | ||
{props.children} | ||
</h3> | ||
) | ||
) | ||
CardTitle.displayName = 'CardTitle' | ||
|
||
const CardDescription = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
>(({ className, ...props }, ref) => ( | ||
<p ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} /> | ||
)) | ||
CardDescription.displayName = 'CardDescription' | ||
|
||
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} /> | ||
) | ||
) | ||
CardContent.displayName = 'CardContent' | ||
|
||
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} /> | ||
) | ||
) | ||
CardFooter.displayName = 'CardFooter' | ||
|
||
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } |
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,23 @@ | ||
/* eslint-disable jsx-a11y/anchor-has-content */ | ||
import Link from 'next/link' | ||
import type { LinkProps } from 'next/link' | ||
import { AnchorHTMLAttributes } from 'react' | ||
|
||
const CustomLink = ({ href, ...rest }: LinkProps & AnchorHTMLAttributes<HTMLAnchorElement>) => { | ||
const isInternalLink = href && href.startsWith('/') | ||
const isAnchorLink = href && href.startsWith('#') | ||
|
||
if (isInternalLink) { | ||
return <Link className="break-words" href={href} {...rest} /> | ||
} | ||
|
||
if (isAnchorLink) { | ||
return <a className="break-words" href={href} {...rest} /> | ||
} | ||
|
||
return ( | ||
<a className="break-words" target="_blank" rel="noopener noreferrer" href={href} {...rest} /> | ||
) | ||
} | ||
|
||
export default CustomLink |
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
Oops, something went wrong.