Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Jan 10, 2025
1 parent d4bc571 commit a9417f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/index/src/components/comment/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
border-radius: 6px;
color: var(--text1);
width: 100%;
height: 142px;
height: 100px;
transition: 0.2s;
padding: 10px 10px;
outline: none;
Expand Down
4 changes: 2 additions & 2 deletions packages/index/src/components/comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface CommentProps {
postId: string
onFocus?: FocusEventHandler<HTMLTextAreaElement>
onBlur?: FocusEventHandler<HTMLTextAreaElement>
comments: any[]
comments?: any[]
player: { current: Player }
setMetaInfo: any
}
Expand Down Expand Up @@ -75,7 +75,7 @@ const Comment = ({ comments, onFocus, onBlur, postId, player, setMetaInfo }: Com
<div className="comment-item__head">
<img className="comment-item__avatar" src={'/ic_launcher_round.png'} alt="" />
<div>
<span className="comment-item__name"># {i}</span>
<span className="comment-item__name"># {comments.length - i}</span>
<p className="comment-item__time">{getTimeDistance(item.createdAt)}</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/index/src/pages/player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function PlayerPage({ id }: any) {
const [source, _] = useState<any>({ poster: 'https://api.imlazy.ink/img', title: 'LOADING ...' })
const [displayEpBar, setDisplayEpBar] = useState(false)

const [metaInfo, setMetaInfo] = useState({ like: 0, comment: [] })
const [metaInfo, setMetaInfo] = useState<{ like: number; comment?: any[] }>({ like: 0 })

useEffect(() => {
// axios.get(`/post/${id}`)
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function PlayerPage({ id }: any) {

const likeHandler = useCallback(() => {
oaii.post(`/like`, { data: { post_id: id } }).then((_) => {
toast.error('你所热爱的,就是你的生活。\r\n --------?')
toast.error('你所热爱的,就是你的生活。\r\n --------?', { id })
setMetaInfo((prev) => ({ comment: prev.comment, like: prev.like + 1 }))
})
}, [])
Expand Down Expand Up @@ -227,7 +227,7 @@ export default function PlayerPage({ id }: any) {
<span className="icon">
<FaMessage />
</span>
<span className="text">{metaInfo.comment.length || '-'}</span>
<span className="text">{metaInfo.comment?.length || '-'}</span>
</div>
<div className={classNames('icon-text')} onClick={likeHandler}>
<span className="icon">
Expand Down

0 comments on commit a9417f7

Please sign in to comment.