|
|
@@ -1,9 +1,10 @@
|
|
|
import { isDevMode } from '@/utils/env'
|
|
|
+import classNames from 'classnames'
|
|
|
import { useState, useRef } from 'react'
|
|
|
import { useIntl } from 'umi'
|
|
|
import './index.less'
|
|
|
|
|
|
-interface StaffItem {
|
|
|
+export type StaffItem = {
|
|
|
avatar: string
|
|
|
id: string
|
|
|
username: string
|
|
|
@@ -35,13 +36,13 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
|
|
|
<>
|
|
|
<span className="absolute top-70 left-[-0.75rem]" onClick={() => setVisible(!visible)}>
|
|
|
<div className="side-bg">
|
|
|
- <span className={['side-bg-current', visible ? 'show-side-bg' : ''].join(' ')} />
|
|
|
+ <span className={classNames('side-bg-current', { 'show-side-bg': visible })} />
|
|
|
</div>
|
|
|
</span>
|
|
|
<div
|
|
|
- className={['book-list flex flex-col bg-hex-ffffff text-hex-666 shadow-card', visible ? 'show-short' : ''].join(
|
|
|
- ' '
|
|
|
- )}
|
|
|
+ className={classNames('book-list flex flex-col bg-hex-ffffff text-hex-666 shadow-card', {
|
|
|
+ 'show-short': visible
|
|
|
+ })}
|
|
|
>
|
|
|
<div className="flex-1 h-full custom-scroll" ref={ref} onScroll={handleOnScroll}>
|
|
|
<div className="w-full">
|
|
|
@@ -49,7 +50,10 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
|
|
|
{visible &&
|
|
|
onlineList.map(item => {
|
|
|
return (
|
|
|
- <li key={item.id} className="table px-2 py-2 text-hex-505050 hover-white hvr-rectangle-out w-full">
|
|
|
+ <li
|
|
|
+ key={item.id}
|
|
|
+ className="table px-2 py-2 text-hex-505050 hover-white hvr-rectangle-out w-full"
|
|
|
+ >
|
|
|
<div className="table-cell align-middle status status-success status-sm ">
|
|
|
<span
|
|
|
className="w-8 h-8 rounded-1/2 block"
|
|
|
@@ -65,9 +69,7 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
|
|
|
<div className="table-cell w-full align-middle pl-2 pr-2">
|
|
|
<div className="max-w-160px overflow-hidden whitespace-nowrap overflow-ellipsis text-sm relative">
|
|
|
<span>{item.username}</span>
|
|
|
- {/* <small className="block italic text-hex-1dc9b7 text-xs">Online</small> */}
|
|
|
<small className="block text-xs">
|
|
|
- {/* <span className="mr-1">正在</span> */}
|
|
|
<span className="italic">
|
|
|
{item.workStatus &&
|
|
|
intl.formatMessage({
|