1
1
import { Suspense } from 'react'
2
2
import Image from 'next/image'
3
3
4
- import { DEFAULT_BLUR_DATA_URL , HREF_PREFIX } from '@/constants'
4
+ import { HREF_PREFIX } from '@/constants'
5
5
import { getFeaturedResourcesCached } from '@/services/cached-queries'
6
6
import { ErrorState } from '@/components/error-state'
7
7
import { LoadingBentoGrid } from '@/components/loading'
@@ -15,7 +15,7 @@ async function ListFeaturedResources() {
15
15
16
16
const [ topResource , ...restResources ] = featuredResources
17
17
18
- const { image , summary, title, url, placeholder } = topResource
18
+ const { summary, title, url } = topResource
19
19
const nextTwoTopResources = restResources . slice ( 0 , 2 )
20
20
21
21
const [ secondPlace , thirdPlace ] = nextTwoTopResources
@@ -25,42 +25,30 @@ async function ListFeaturedResources() {
25
25
const { summary : thirdPlaceSummary , title : thirdPlaceTitle , url : thirdPlaceUrl } = thirdPlace
26
26
27
27
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' >
29
29
{ /* First place */ }
30
30
< a
31
31
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'
32
32
href = { `${ HREF_PREFIX } ${ url } ` }
33
33
target = '_blank'
34
34
rel = 'noopener noreferrer'
35
35
>
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' >
37
37
< Image
38
38
unoptimized
39
39
src = { `https://www.google.com/s2/favicons?domain=${ url } &sz=128` }
40
40
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 }
44
44
/>
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' >
46
46
{ title }
47
47
</ h2 >
48
48
</ 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 ' >
50
50
{ summary }
51
51
</ 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 >
64
52
</ a >
65
53
{ /* Second place */ }
66
54
< a
@@ -74,11 +62,11 @@ async function ListFeaturedResources() {
74
62
unoptimized
75
63
src = { `https://www.google.com/s2/favicons?domain=${ secondPlaceUrl } &sz=128` }
76
64
alt = { `Logo for ${ secondPlaceTitle } ` }
77
- className = 'rounded-md'
65
+ className = 'rounded-md size-6 md:size-8 '
78
66
width = { 32 }
79
67
height = { 32 }
80
68
/>
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' >
82
70
{ secondPlaceTitle }
83
71
</ h2 >
84
72
</ div >
@@ -96,11 +84,11 @@ async function ListFeaturedResources() {
96
84
unoptimized
97
85
src = { `https://www.google.com/s2/favicons?domain=${ thirdPlaceUrl } &sz=128` }
98
86
alt = { `Logo for ${ thirdPlaceTitle } ` }
99
- className = 'rounded-md'
87
+ className = 'rounded-md size-6 md:size-8 '
100
88
width = { 32 }
101
89
height = { 32 }
102
90
/>
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 >
104
92
</ div >
105
93
< p className = 'text-sm text-gray-200 line-clamp-4' > { thirdPlaceSummary } </ p >
106
94
</ a >
@@ -119,11 +107,11 @@ async function ListFeaturedResources() {
119
107
unoptimized
120
108
src = { `https://www.google.com/s2/favicons?domain=${ url } &sz=128` }
121
109
alt = { `Logo for ${ title } ` }
122
- className = 'rounded-lg '
110
+ className = 'rounded-md size-6 md:size-8 '
123
111
width = { 32 }
124
112
height = { 32 }
125
113
/>
126
- < span className = 'text-lg font-semibold' > { title } </ span >
114
+ < span className = 'text-base xl:text- lg font-semibold' > { title } </ span >
127
115
</ a >
128
116
< p className = 'text-sm line-clamp-3' > { summary } </ p >
129
117
</ div >
0 commit comments