设备管理当前设备置顶且显示黄色边框
This commit is contained in:
@@ -2788,12 +2788,23 @@ export const UserMenu: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className='space-y-3'>
|
<div className='space-y-3'>
|
||||||
{devices.map((device) => {
|
{devices
|
||||||
|
.sort((a, b) => {
|
||||||
|
// 当前设备置顶
|
||||||
|
if (a.isCurrent && !b.isCurrent) return -1;
|
||||||
|
if (!a.isCurrent && b.isCurrent) return 1;
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
.map((device) => {
|
||||||
const DeviceIcon = getDeviceIcon(device.deviceInfo);
|
const DeviceIcon = getDeviceIcon(device.deviceInfo);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={device.tokenId}
|
key={device.tokenId}
|
||||||
className='p-4 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700'
|
className={`p-4 bg-gray-50 dark:bg-gray-800 rounded-lg border ${
|
||||||
|
device.isCurrent
|
||||||
|
? 'border-yellow-400 dark:border-yellow-500'
|
||||||
|
: 'border-gray-200 dark:border-gray-700'
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
<div className='flex items-start justify-between'>
|
<div className='flex items-start justify-between'>
|
||||||
<div className='flex-1'>
|
<div className='flex-1'>
|
||||||
|
|||||||
Reference in New Issue
Block a user