@@ -4,7 +4,6 @@ import { HiOutlineClock, HiOutlineEye } from 'react-icons/hi';
4
4
5
5
import Accent from '@/components/Accent' ;
6
6
import Tag from '@/components/content/Tag' ;
7
- import CloudinaryImg from '@/components/images/CloudinaryImg' ;
8
7
import UnstyledLink from '@/components/links/UnstyledLink' ;
9
8
10
9
import { BlogFrontmatter , InjectedMeta } from '@/types/frontmatters' ;
@@ -36,20 +35,36 @@ export default function BlogCard({
36
35
className = 'block h-full rounded-md focus:outline-none focus-visible:ring focus-visible:ring-primary-300'
37
36
href = { `/blog/${ post . slug } ` }
38
37
>
39
- < div className = 'relative' >
40
- < CloudinaryImg
41
- noStyle
42
- className = 'pointer-events-none overflow-hidden rounded-t-md'
43
- publicId = { `banner/${ post . banner } ` }
44
- alt = 'Photo taken from unsplash'
45
- width = { 1200 }
46
- height = { ( 1200 * 2 ) / 5 }
47
- aspect = { { height : 2 , width : 5 } }
48
- preview = { false }
49
- />
38
+ < div className = 'flex items-end p-4' >
39
+ { /* blog_info */ }
40
+ < div className = 'w-full' >
41
+ < h4 className = 'text-gray-800 dark:text-gray-100' > { post . title } </ h4 >
42
+ < p className = 'mt-4 mb-2 text-sm text-gray-600 dark:text-gray-300' >
43
+ < span className = 'font-bold text-gray-800 dark:text-gray-100' >
44
+ { format (
45
+ new Date ( post . lastUpdated ?? post . publishedAt ) ,
46
+ 'MMMM dd, yyyy'
47
+ ) }
48
+ </ span >
49
+ </ p >
50
+ < p className = 'text-sm text-gray-700 dark:text-gray-300' >
51
+ { post . description }
52
+ </ p >
53
+ < div className = 'mt-2 flex items-center justify-start gap-2 text-sm font-medium text-gray-600 dark:text-gray-300' >
54
+ < div className = 'flex items-center gap-1' >
55
+ < HiOutlineClock className = 'inline-block text-base' />
56
+ { post . readingTime . text }
57
+ </ div >
58
+ < div className = 'flex items-center gap-1' >
59
+ < HiOutlineEye className = 'inline-block text-base' />
60
+ { post ?. views ?. toLocaleString ( ) ?? '-' } views
61
+ </ div >
62
+ </ div >
63
+ </ div >
64
+ { /* tags */ }
50
65
< div
51
66
className = { clsx (
52
- 'absolute bottom-0 w-full px-4 py-2' ,
67
+ 'w-full px-4 py-2' ,
53
68
'mt-2 flex flex-wrap justify-end gap-y-1 gap-x-2 text-sm text-black dark:text-gray-100'
54
69
) }
55
70
>
@@ -64,30 +79,6 @@ export default function BlogCard({
64
79
) ) }
65
80
</ div >
66
81
</ div >
67
- < div className = 'p-4' >
68
- < h4 className = 'text-gray-800 dark:text-gray-100' > { post . title } </ h4 >
69
- < div className = 'mt-2 flex items-center justify-start gap-2 text-sm font-medium text-gray-600 dark:text-gray-300' >
70
- < div className = 'flex items-center gap-1' >
71
- < HiOutlineClock className = 'inline-block text-base' />
72
- { post . readingTime . text }
73
- </ div >
74
- < div className = 'flex items-center gap-1' >
75
- < HiOutlineEye className = 'inline-block text-base' />
76
- { post ?. views ?. toLocaleString ( ) ?? '-' } views
77
- </ div >
78
- </ div >
79
- < p className = 'mt-4 mb-2 text-sm text-gray-600 dark:text-gray-300' >
80
- < span className = 'font-bold text-gray-800 dark:text-gray-100' >
81
- { format (
82
- new Date ( post . lastUpdated ?? post . publishedAt ) ,
83
- 'MMMM dd, yyyy'
84
- ) }
85
- </ span >
86
- </ p >
87
- < p className = 'text-sm text-gray-700 dark:text-gray-300' >
88
- { post . description }
89
- </ p >
90
- </ div >
91
82
</ UnstyledLink >
92
83
</ li >
93
84
) ;
0 commit comments