Files
jonbio/app/likes/page.tsx
T
trex Bot 5de7b04e6d fix(likes): stack rows on mobile
The 240px thumbnail plus text overflowed below the sm breakpoint. Stack
the image above the text on small screens and hide the arrow there.
2026-11-20 11:28:13 -06:00

72 lines
3.0 KiB
TypeScript

import likesData from '@/data/likesData'
import Image from '@/components/Image'
import Link from '@/components/Link'
import { genPageMetadata } from 'app/seo'
export const metadata = genPageMetadata({ title: 'Likes' })
export default function Likes() {
return (
<div className="divide-y divide-gray-200 dark:divide-gray-700">
<div className="space-y-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14">
Likes
<span className="ml-3 inline-block rounded-full border border-primary-500/40 px-2.5 py-0.5 align-middle text-xs font-semibold uppercase tracking-wide text-primary-500">
{likesData.length} things
</span>
</h1>
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400">
These things are pretty cool, check &apos;em out.
</p>
</div>
<ul className="py-2">
{likesData.map((d) => (
<li key={d.title} className="border-b border-gray-200 last:border-0 dark:border-gray-700">
<Link
href={d.href}
aria-label={`Link to ${d.title}`}
className="group flex flex-col gap-4 rounded-lg px-2 py-5 transition-colors hover:bg-gray-100 dark:hover:bg-gray-900 sm:flex-row sm:items-center sm:gap-5 sm:px-4"
>
<span className="aspect-video w-full flex-none overflow-hidden rounded-lg border border-gray-200 bg-gray-200 dark:border-gray-700 dark:bg-gray-800 sm:aspect-auto sm:h-[135px] sm:w-[240px]">
<Image
src={d.imgSrc}
alt={d.title}
width={480}
height={270}
className="h-full w-full object-cover object-center"
/>
</span>
<span className="min-w-0 flex-1">
<span className="block text-xl font-semibold tracking-tight text-gray-900 dark:text-gray-100">
{d.title}
</span>
<span className="mt-1.5 block max-w-[46ch] text-[15px] text-gray-500 dark:text-gray-400">
{d.description}
</span>
{d.host && (
<span className="mt-2.5 block font-mono text-xs text-gray-500 dark:text-gray-400">
{d.host}
</span>
)}
</span>
<svg
className="hidden h-5 w-5 flex-none text-primary-500 opacity-60 transition group-hover:opacity-100 sm:block"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M7 17 17 7" />
<path d="M8 7h9v9" />
</svg>
</Link>
</li>
))}
</ul>
</div>
)
}