From dbc53a555e64fdd0b848bf33b4208820b8701509 Mon Sep 17 00:00:00 2001 From: Parker Date: Wed, 13 Nov 2024 22:45:57 -0600 Subject: Update UI --- app/src/components/Navbar.tsx | 56 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) (limited to 'app/src/components/Navbar.tsx') diff --git a/app/src/components/Navbar.tsx b/app/src/components/Navbar.tsx index 5107bf4..53c1f52 100644 --- a/app/src/components/Navbar.tsx +++ b/app/src/components/Navbar.tsx @@ -1,21 +1,63 @@ +import { useState, useEffect } from 'react'; import styles from '../styles/Navbar.module.css'; import { Link } from 'react-router-dom'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faCircleUp, faCircleDown } from '@fortawesome/free-solid-svg-icons'; function Navbar() { + const [isOnline, setIsOnline] = useState(null); + + useEffect(() => { + const checkAPIStatus = async () => { + try { + const res = await fetch('/api/ping'); + + if (res.status === 200) { + setIsOnline(true); + } else { + setIsOnline(false); + } + } catch (error) { + setIsOnline(false); + } + }; + + checkAPIStatus(); + }); + return (
-
+
- Login + Login - Signup + Signup
-
- - API Status - +
); -- cgit v1.2.3-70-g09d2