diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index 01a3cdf1..b99cbc8e 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -1,11 +1,52 @@ -import { SiReplit } from 'react-icons/si' +import { SiDiscord, SiReplit } from 'react-icons/si' import Icon from '../static/Icons' import { git, npm } from '../static/icons_list' import bento from '../../assets/bento.svg' import tor from '../../assets/tor.svg' import './index.css' - +import { useEffect, useState } from 'react' +type DiscordStatus = "dnd" | "idle" | "online" | "offline" +type Data = { + discord_status: DiscordStatus, + kv: { + //@ts-ignore if u have a problem js slap that + is_disabled?: string, + [key: string]: string + } +} +function getFillColor(s: DiscordStatus): string { + switch(s) { + case "dnd": +return "var(--red)" + break; + case "idle": + return "var(--yellow)" + break; + case "online": + return "var(--green)" + break; + case "offline": + return "var(--overlay1)" + break; +default: +return "var(--mauve)" +break; + } +} export default function Footer () { + const [lanyardData, setData] = useState(null) + useEffect(() => { + const signal = new AbortController() + if(!lanyardData) { + fetch("https://api.lanyard.rest/v1/users/566766267046821888", { signal: signal.signal }).then(r=>r.json()).then(json => { + if(json.success) { + console.log(json.data) + setData(json.data as Data) + } + }) + } + // return () => signal.abort() + }) return <>