|
|
@ -72,7 +72,7 @@ export default function Header() { |
|
|
|
setNickname(userData.nickname); |
|
|
|
} |
|
|
|
} |
|
|
|
},[userInfo.nickname]); |
|
|
|
}, [userInfo.nickname]); |
|
|
|
|
|
|
|
const [messageApi, contextHolder] = message.useMessage(); |
|
|
|
const [nickname, setNickname] = useState<string>(); |
|
|
@ -159,20 +159,24 @@ export default function Header() { |
|
|
|
return ( |
|
|
|
<> |
|
|
|
{contextHolder} |
|
|
|
<div className="bg-[--bgColor] h-full flex items-center"> |
|
|
|
<section className="ml-auto rounded-md h-9 mr-4 flex items-center bg-white gap-2 pl-4"> |
|
|
|
<span className="w-[94px]">温度:{deviceInfo.temperature.toFixed(1)}℃ </span> |
|
|
|
<span className="w-[120px]">X轴倾斜:{deviceInfo.inclinatorX}</span> |
|
|
|
<span className="w-[120px]">Y轴倾斜:{deviceInfo.inclinatorY}</span> |
|
|
|
</section> |
|
|
|
<section className="bg-white rounded-md h-9 w-12 relative mr-3 flex justify-center items-center"> |
|
|
|
<img |
|
|
|
src={icon_battery} |
|
|
|
className="absolute h-8 w-10 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
<p className="text-primary text-xs">{deviceInfo.power.toFixed()}%</p> |
|
|
|
</section> |
|
|
|
<div className="bg-[--bgColor] h-full flex justify-end items-center"> |
|
|
|
{deviceInfo.isConnected && ( |
|
|
|
<> |
|
|
|
<section className=" rounded-md h-9 mr-4 flex items-center bg-white gap-2 pl-4"> |
|
|
|
<span className="w-[94px]">温度:{deviceInfo.temperature.toFixed(1)}℃ </span> |
|
|
|
<span className="w-[120px]">X轴倾斜:{deviceInfo.inclinatorX}</span> |
|
|
|
<span className="w-[120px]">Y轴倾斜:{deviceInfo.inclinatorY}</span> |
|
|
|
</section> |
|
|
|
<section className="bg-white rounded-md h-9 w-12 relative mr-3 flex justify-center items-center"> |
|
|
|
<img |
|
|
|
src={icon_battery} |
|
|
|
className="absolute h-8 w-10 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
<p className="text-primary text-xs">{deviceInfo.power.toFixed()}%</p> |
|
|
|
</section> |
|
|
|
</> |
|
|
|
)} |
|
|
|
{/* <section className="bg-white rounded-md h-9 w-10 flex justify-center items-center mr-3"> |
|
|
|
<img src={icon_usb} className="w-6" alt="icon" /> |
|
|
|
</section> */} |
|
|
|