Loading component

This commit is contained in:
djmil 2023-11-06 09:29:13 +01:00
parent 472f5de928
commit df60508d45
4 changed files with 9 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import React, { useReducer } from 'react'
import { BrowserRouter, Routes, Route } from "react-router-dom" import { BrowserRouter, Routes, Route } from "react-router-dom"
import Header from "./container/Header" import Header from "./container/Header"
import Leaderboard from "./components/Leaderboard" import Leaderboard from "./container/Leaderboard"
import Game from "./components/Game" import Game from "./components/Game"
import About from "./components/About" import About from "./components/About"

View File

@ -0,0 +1,5 @@
import React from "react"
export default function Loading() {
return <div className="Loading">Loading...</div>
}

View File

@ -1,10 +1,11 @@
import './Leaderboard.css';
import React from "react" import React from "react"
import './index.css'; import Loading from '../components/Loading';
export default function Leaderboard({ leaderboard }) { export default function Leaderboard({ leaderboard }) {
if (leaderboard == null) if (leaderboard == null)
return <p>Loading...</p> return <Loading />
// var listItems = Object.keys(data).map(playerName => { // var listItems = Object.keys(data).map(playerName => {
// var rank = data[playerName]; // var rank = data[playerName];