Loading component
This commit is contained in:
parent
472f5de928
commit
df60508d45
@ -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"
|
||||||
|
|
||||||
|
5
webapp/src/components/Loading.jsx
Normal file
5
webapp/src/components/Loading.jsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import React from "react"
|
||||||
|
|
||||||
|
export default function Loading() {
|
||||||
|
return <div className="Loading">Loading...</div>
|
||||||
|
}
|
@ -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];
|
Loading…
Reference in New Issue
Block a user