fix: mesage time update

This commit is contained in:
molvqingtai 2024-09-25 04:52:41 +08:00
parent 420586839a
commit 90253effa6

View file

@ -12,7 +12,7 @@ const Header: FC = () => {
const roomDomain = useRemeshDomain(RoomDomain()) const roomDomain = useRemeshDomain(RoomDomain())
const userList = useRemeshQuery(roomDomain.query.UserListQuery()) const userList = useRemeshQuery(roomDomain.query.UserListQuery())
const peerId = useRemeshQuery(roomDomain.query.PeerIdQuery()) const peerId = useRemeshQuery(roomDomain.query.PeerIdQuery())
const onlineCount = userList.length > 99 ? '99+' : userList.length const onlineCount = userList.length
return ( return (
<div className="z-10 grid h-12 grid-flow-col grid-cols-[theme('spacing.20')_auto_theme('spacing.20')] items-center justify-between rounded-t-xl bg-white px-4 backdrop-blur-lg"> <div className="z-10 grid h-12 grid-flow-col grid-cols-[theme('spacing.20')_auto_theme('spacing.20')] items-center justify-between rounded-t-xl bg-white px-4 backdrop-blur-lg">
@ -53,17 +53,17 @@ const Header: FC = () => {
<span <span
className={cn( className={cn(
'absolute inline-flex size-full animate-ping rounded-full opacity-75', 'absolute inline-flex size-full animate-ping rounded-full opacity-75',
onlineCount === 1 ? 'bg-orange-400' : 'bg-green-400' onlineCount > 1 ? 'bg-green-400' : 'bg-orange-400'
)} )}
></span> ></span>
<span <span
className={cn( className={cn(
'relative inline-flex size-2 rounded-full', 'relative inline-flex size-2 rounded-full',
onlineCount === 1 ? 'bg-orange-500' : 'bg-green-500' onlineCount > 1 ? 'bg-green-500' : 'bg-orange-500'
)} )}
></span> ></span>
</span> </span>
<span>ONLINE {onlineCount}</span> <span>ONLINE {onlineCount > 99 ? '99+' : onlineCount}</span>
</div> </div>
</div> </div>
) )