chore: remove unused stuff
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { apiAuth } from "./api";
|
||||
import BarChart from "./BarChart";
|
||||
import { PlayerRanking } from "./types";
|
||||
import RaceChart from "./RaceChart";
|
||||
|
||||
|
||||
const MVPChart = () => {
|
||||
const [data, setData] = useState({} as PlayerRanking[]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -13,17 +11,26 @@ const MVPChart = () => {
|
||||
async function loadData() {
|
||||
setLoading(true);
|
||||
await apiAuth("analysis/mvp", null)
|
||||
.then(json => json as Promise<PlayerRanking[]>).then(json => { setData(json.sort((a, b) => a.rank - b.rank)) })
|
||||
.then((json) => json as Promise<PlayerRanking[]>)
|
||||
.then((json) => {
|
||||
setData(json.sort((a, b) => a.rank - b.rank));
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
useEffect(() => { loadData() }, [])
|
||||
useEffect(() => {
|
||||
loadData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{loading ? <span className="loader" /> : <RaceChart std={showStd} players={data} />
|
||||
}
|
||||
</>)
|
||||
}
|
||||
{loading ? (
|
||||
<span className="loader" />
|
||||
) : (
|
||||
<RaceChart std={showStd} players={data} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MVPChart;
|
||||
|
Reference in New Issue
Block a user