@@ -6,6 +6,7 @@ import React from 'react'
66
77import DateComponent from '../components/DateComponent'
88import { CommonPostTypeOpts } from '../components/PostsList'
9+ import TooltipX from '../components/tooltip-x'
910import BlogIcon from '../icons/BlogIcon'
1011import BsPinAngleFill from '../icons/BsPinAngleFill'
1112import HiMiniCheckBadge from '../icons/HiMiniCheckBadge'
@@ -40,18 +41,7 @@ export default function PostSimple(props: PostSimpleProps) {
4041 className = { cn ( options ?. fontClassName , 'flex items-start gap-3 p-4' ) }
4142 href = { post . uri || '/' }
4243 >
43- < div
44- className = { cn ( 'mt-[3px] text-slate-600 relative' , {
45- 'tooltip-auto' : post . wellWritten || post . blog
46- } ) }
47- data-title = {
48- post . blog
49- ? options ?. blogLabel ?? 'A blog post' // Must come before wellWritten
50- : post . wellWritten
51- ? options ?. wellWrittenLabel ?? 'Well written, verified by the author'
52- : undefined
53- }
54- >
44+ < div className = { cn ( 'mt-[3px] text-slate-600 relative' ) } id = { `well-blog-${ post . id } ` } >
5545 { ! ! options ?. customIcon && ( ! options . showPinned || ! post . pinned ) && options . customIcon }
5646 { ! options ?. customIcon && ( ! options ?. showPinned || ! post . pinned ) && (
5747 < >
@@ -66,6 +56,15 @@ export default function PostSimple(props: PostSimpleProps) {
6656 </ span >
6757 ) }
6858 </ div >
59+ { ( post . wellWritten || post . blog ) && (
60+ < TooltipX id = { `#well-blog-${ post . id } ` } >
61+ { post . blog
62+ ? options ?. blogLabel ?? 'A blog post' // Must come before wellWritten
63+ : post . wellWritten
64+ ? options ?. wellWrittenLabel ?? 'Well written, verified by the author'
65+ : undefined }
66+ </ TooltipX >
67+ ) }
6968
7069 < div className = "flex flex-1 items-start justify-between gap-x-3 gap-y-1.5 flex-col md:flex-row" >
7170 < h3 className = "flex-1" >
@@ -87,14 +86,17 @@ export default function PostSimple(props: PostSimpleProps) {
8786 { /* title */ }
8887 { post . title } { /* draft */ }
8988 { post . isDraft && (
90- < span
91- className = { cn (
92- 'bg-slate-100 text-slate-600 px-2 py-0 text-[0.8rem] rounded-md tooltip-auto'
93- ) }
94- data-title = { options ?. tooltipDraftLabel || 'The content is not so good yet' }
95- >
96- { options ?. draftLabel || 'draft' }
97- </ span >
89+ < >
90+ < span
91+ id = { `draft-${ post . id } ` }
92+ className = { cn ( 'bg-slate-100 text-slate-600 px-2 py-0 text-[0.8rem] rounded-md' ) }
93+ >
94+ { options ?. draftLabel || 'draft' }
95+ </ span >
96+ < TooltipX id = { `#draft-${ post . id } ` } >
97+ { options ?. tooltipDraftLabel || 'The content is not so good yet' }
98+ </ TooltipX >
99+ </ >
98100 ) }
99101 </ h3 >
100102 { /* date status on big screen */ }
0 commit comments