Skip to content

Commit f6bdc71

Browse files
committed
update top card resource
1 parent aef7913 commit f6bdc71

File tree

2 files changed

+16
-28
lines changed

2 files changed

+16
-28
lines changed

src/components/featured-resources.tsx

+15-27
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Suspense } from 'react'
22
import Image from 'next/image'
33

4-
import { DEFAULT_BLUR_DATA_URL, HREF_PREFIX } from '@/constants'
4+
import { HREF_PREFIX } from '@/constants'
55
import { getFeaturedResourcesCached } from '@/services/cached-queries'
66
import { ErrorState } from '@/components/error-state'
77
import { LoadingBentoGrid } from '@/components/loading'
@@ -15,7 +15,7 @@ async function ListFeaturedResources() {
1515

1616
const [topResource, ...restResources] = featuredResources
1717

18-
const { image, summary, title, url, placeholder } = topResource
18+
const { summary, title, url } = topResource
1919
const nextTwoTopResources = restResources.slice(0, 2)
2020

2121
const [secondPlace, thirdPlace] = nextTwoTopResources
@@ -25,42 +25,30 @@ async function ListFeaturedResources() {
2525
const { summary: thirdPlaceSummary, title: thirdPlaceTitle, url: thirdPlaceUrl } = thirdPlace
2626

2727
return (
28-
<div className='py-6 grid grid-cols-1 lg:grid-cols-[350px_repeat(2,_1fr)] xl:grid-cols-[500px_repeat(2,_1fr)] gap-4'>
28+
<div className='py-6 grid grid-cols-1 lg:grid-cols-[350px_repeat(2,_1fr)] xl:grid-cols-[450px_repeat(2,_1fr)] gap-4'>
2929
{/* First place */}
3030
<a
3131
className='size-full bg-gradient-to-br from-yellow-50 to-amber-200 dark:from-yellow-100 dark:to-amber-300 border-2 border-yellow-200 hover:border-yellow-500 hover:dark:border-yellow-700 transition-colors p-6 rounded-lg col-span-1 row-span-1 lg:row-span-2 xl:row-span-3'
3232
href={`${HREF_PREFIX}${url}`}
3333
target='_blank'
3434
rel='noopener noreferrer'
3535
>
36-
<div className='flex items-center gap-2 mb-4'>
36+
<div className='flex flex-row xl:flex-col items-center md:items-start gap-2 md:gap-4 xl:mt-40 mb-4'>
3737
<Image
3838
unoptimized
3939
src={`https://www.google.com/s2/favicons?domain=${url}&sz=128`}
4040
alt={`Logo for ${title}`}
41-
className='rounded-md'
42-
width={32}
43-
height={32}
41+
className='rounded-md size-6 xl:size-16'
42+
width={64}
43+
height={64}
4444
/>
45-
<h2 className='text-base lg:text-3xl font-bold text-gray-900 dark:text-gray-800'>
45+
<h2 className='text-base xl:text-6xl font-bold text-gray-900 dark:text-gray-800'>
4646
{title}
4747
</h2>
4848
</div>
49-
<p className='text-sm lg:text-base text-gray-700 mb-4 line-clamp-3 sm:line-clamp-5'>
49+
<p className='text-sm xl:text-lg text-gray-700 line-clamp-3 sm:line-clamp-5 xl:mt-8'>
5050
{summary}
5151
</p>
52-
<div className='h-[300px] w-full relative mt-24 shadow-lg rounded-md overflow-hidden hidden xl:block'>
53-
<Image
54-
src={image}
55-
fill
56-
alt={`Picture of ${title}`}
57-
className='object-cover'
58-
decoding='async'
59-
placeholder='blur'
60-
blurDataURL={placeholder ?? DEFAULT_BLUR_DATA_URL}
61-
sizes='(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw'
62-
/>
63-
</div>
6452
</a>
6553
{/* Second place */}
6654
<a
@@ -74,11 +62,11 @@ async function ListFeaturedResources() {
7462
unoptimized
7563
src={`https://www.google.com/s2/favicons?domain=${secondPlaceUrl}&sz=128`}
7664
alt={`Logo for ${secondPlaceTitle}`}
77-
className='rounded-md'
65+
className='rounded-md size-6 md:size-8'
7866
width={32}
7967
height={32}
8068
/>
81-
<h2 className='text-lg font-semibold text-gray-900 dark:text-gray-800'>
69+
<h2 className='text-base xl:text-lg font-semibold text-gray-900 dark:text-gray-800'>
8270
{secondPlaceTitle}
8371
</h2>
8472
</div>
@@ -96,11 +84,11 @@ async function ListFeaturedResources() {
9684
unoptimized
9785
src={`https://www.google.com/s2/favicons?domain=${thirdPlaceUrl}&sz=128`}
9886
alt={`Logo for ${thirdPlaceTitle}`}
99-
className='rounded-md'
87+
className='rounded-md size-6 md:size-8'
10088
width={32}
10189
height={32}
10290
/>
103-
<h2 className='text-lg font-semibold text-white'>{thirdPlaceTitle}</h2>
91+
<h2 className='text-base xl:text-lg font-semibold text-white'>{thirdPlaceTitle}</h2>
10492
</div>
10593
<p className='text-sm text-gray-200 line-clamp-4'>{thirdPlaceSummary}</p>
10694
</a>
@@ -119,11 +107,11 @@ async function ListFeaturedResources() {
119107
unoptimized
120108
src={`https://www.google.com/s2/favicons?domain=${url}&sz=128`}
121109
alt={`Logo for ${title}`}
122-
className='rounded-lg'
110+
className='rounded-md size-6 md:size-8'
123111
width={32}
124112
height={32}
125113
/>
126-
<span className='text-lg font-semibold'>{title}</span>
114+
<span className='text-base xl:text-lg font-semibold'>{title}</span>
127115
</a>
128116
<p className='text-sm line-clamp-3'>{summary}</p>
129117
</div>

src/components/loading.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function LoadingCards() {
4141

4242
export function LoadingBentoGrid() {
4343
return (
44-
<div className='mt-4 grid grid-cols-1 lg:grid-cols-[350px_repeat(2,_1fr)] xl:grid-cols-[500px_repeat(2,_1fr)] gap-4'>
44+
<div className='mt-4 grid grid-cols-1 lg:grid-cols-[350px_repeat(2,_1fr)] xl:grid-cols-[450px_repeat(2,_1fr)] gap-4'>
4545
{/* First place */}
4646
<div className='bg-neutral-200 dark:bg-neutral-900 animate-pulse rounded-lg col-span-1 md:row-span-3'></div>
4747
{/* Second place */}

0 commit comments

Comments
 (0)