From 7ceec618b44dbfb5ca14dd0846eaca6757ae4572 Mon Sep 17 00:00:00 2001 From: matthewrostkowski <69280162+matthewrostkowski@users.noreply.github.com> Date: Wed, 22 May 2024 01:53:38 -0400 Subject: [PATCH] Update rover.js (#26) updates to rover --- src/pages/focus/rover.js | 145 ++++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 31 deletions(-) diff --git a/src/pages/focus/rover.js b/src/pages/focus/rover.js index d794c26..72ac2c8 100644 --- a/src/pages/focus/rover.js +++ b/src/pages/focus/rover.js @@ -1,7 +1,80 @@ import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; import Map from '../../components/Map.js'; import RoverCam from "../../components/RoverCamera.js"; -import '../../pages-style/rover.css'; + +const PageContainer = styled.div` + display: flex; + flex-direction: column; + height: 100vh; +`; + +const ContentRover = styled.div` + display: flex; + flex: 1; +`; + +const LeftColumnRover = styled.div` + display: flex; + flex-direction: column; + width: 50%; +`; + +const RoverCamContainer = styled.div` + flex: 1; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + padding-bottom: 30px; + padding-top: 30px; +`; +const StreamContainer = styled.div` + padding-bottom: 30px; +`; +const MapContainer = styled.div` + flex: 1; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; +`; + +const RightColumnRover = styled.div` + width: 50%; + display: flex; + justify-content: center; + align-items: center; + padding: 10px; + background-color: #f0f0f0; + overflow: auto; +`; + +const Table = styled.table` + width: 100%; + border-collapse: collapse; + margin: 20px 0; +`; + +const TableHead = styled.thead` + background-color: #f2f2f2; +`; + +const TableHeader = styled.th` + padding: 10px; + border: 1px solid #ddd; +`; + +const TableRow = styled.tr` + &:nth-child(even) { + background-color: #f9f9f9; + } +`; + +const TableCell = styled.td` + padding: 10px; + border: 1px solid #ddd; +`; function Rover() { const [roverData, setRoverData] = useState(null); @@ -17,49 +90,59 @@ function Rover() { } }; + // Fetch data initially fetchData(); + // Set up interval to fetch data every second const intervalId = setInterval(fetchData, 1000); + // Clean up interval on component unmount return () => clearInterval(intervalId); }, []); return ( -