From d69a7c1980d28d2ae7e8b02275b3416e28b0103e Mon Sep 17 00:00:00 2001 From: Focusvity Date: Thu, 30 Jun 2022 20:09:23 +1000 Subject: [PATCH] Clean clean clean --- src/App.tsx | 1 - src/css/DownloadPage.css | 4 ++++ src/index.tsx | 1 - src/pages/DownloadPage.tsx | 13 +++++-------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 315c8679..2f73cdcb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { BrowserRouter, Route, Routes } from "react-router-dom"; import HomePage from "./pages/HomePage"; import { Button, Nav, Navbar, NavLink, NavDropdown, Container } from "react-bootstrap"; diff --git a/src/css/DownloadPage.css b/src/css/DownloadPage.css index 48d09ab5..03c608b1 100644 --- a/src/css/DownloadPage.css +++ b/src/css/DownloadPage.css @@ -50,6 +50,10 @@ tr:nth-child(odd) { background-color: #3c3c3c; } +tr:nth-child(even) { + background-color: #2c2c2c; +} + td { height: 70px; color: white; diff --git a/src/index.tsx b/src/index.tsx index f9133920..47d8dbaa 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; diff --git a/src/pages/DownloadPage.tsx b/src/pages/DownloadPage.tsx index 21440ee5..dc5e71da 100644 --- a/src/pages/DownloadPage.tsx +++ b/src/pages/DownloadPage.tsx @@ -10,8 +10,7 @@ const DownloadPage = () => { const [version, setVersion] = useState("1.19") const versions = ["1.17.1", "1.18.2", "1.19"] useEffect(() => { - doJobs().then(value => { - }) + doJobs() }, []) function doJobs(): Promise { @@ -25,9 +24,7 @@ const DownloadPage = () => { getBuilds(job.name).then(value1 => { setJobs(prevState => { - let newState = new Map(prevState) - newState.set(job, value1) - return newState + return new Map(prevState).set(job, value1) }) resolve() }) @@ -47,10 +44,10 @@ const DownloadPage = () => { {Array.from(jobs.keys()).sort(function (x, y) { let x1 = x.name.split(".") let y1 = y.name.split(".") - if (x1.length >= 3) { + if (x1.length === 3) { x1 = x1.slice(0, x1.length - 1) } - if (y1.length >= 3) { + if (y1.length === 3) { y1 = y1.slice(0, y1.length - 1) } return y1.join(".") > x1.join(".") ? 1 : -1 @@ -61,7 +58,7 @@ const DownloadPage = () => {

- {jobs.get(Array.from(jobs.keys()).filter(value => value.name == version)[0])?.map(value => { + {jobs.get(Array.from(jobs.keys()).filter(value => value.name === version)[0])?.map(value => { return
    {value.changes?.map(value1 => {