0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-23 12:40:11 +09:00

Compare commits

..

No commits in common. "09184f93dfc8742793069add6e873a6722178a2d" and "c14961d1d2bc02e5f4648425a7181e7283d53b22" have entirely different histories.

View File

@ -12,26 +12,20 @@ const App = () => {
}; };
fetchData(); fetchData();
}, []); }, []);
const str = JSON.stringify(data) const status = data.members && data.members[0].status;
let status = 0
if (str.indexOf("status") !== -1){
status = data.members && data.members[0].status;
}
return ( return (
<> <>
<div className="z-50 w-6 transform translate-y-3/4 -translate-x-full"> <div className="z-50 w-6 transform translate-y-3/4 -translate-x-full">
{ {
(() => { (() => {
if (status == 0) {
return <div className="text-gray-700 rounded-full bg-gray-500 flex w-6 h-6"></div>
}else{
if (status == "online"){ if (status == "online"){
return <div className="text-green-700 rounded-full bg-green-500 flex w-6 h-6"></div> return <div className="text-green-700 rounded-full bg-green-500 flex w-6 h-6"></div>
} else if (status == "idle"){ } else if (status == "idle"){
return <div className="text-yellow-700 rounded-full bg-green-500 flex w-6 h-6"></div> return <div className="text-yellow-700 rounded-full bg-green-500 flex w-6 h-6"></div>
} else { } else if (status == "dnd"){
return <div className="text-yellow-700 rounded-full bg-red-500 flex w-6 h-6"></div> return <div className="text-yellow-700 rounded-full bg-red-500 flex w-6 h-6"></div>
} } else {
return <div className="text-gray-700 rounded-full bg-red-500 flex w-6 h-6"></div>
} }
})() })()
} }