feat: fix RaceChart height when N<3
This commit is contained in:
parent
8bc38a10a4
commit
8c938a7ebc
@ -1,4 +1,4 @@
|
|||||||
import { ReactNode, useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { apiAuth } from "./api";
|
import { apiAuth } from "./api";
|
||||||
import { PlayerRanking } from "./types";
|
import { PlayerRanking } from "./types";
|
||||||
import RaceChart from "./RaceChart";
|
import RaceChart from "./RaceChart";
|
||||||
|
@ -16,7 +16,7 @@ const determineNiceWidth = (width: number) => {
|
|||||||
const RaceChart: FC<RaceChartProps> = ({ players, std }) => {
|
const RaceChart: FC<RaceChartProps> = ({ players, std }) => {
|
||||||
const [width, setWidth] = useState(determineNiceWidth(window.innerWidth));
|
const [width, setWidth] = useState(determineNiceWidth(window.innerWidth));
|
||||||
//const [height, setHeight] = useState(window.innerHeight);
|
//const [height, setHeight] = useState(window.innerHeight);
|
||||||
const height = players.length * 40;
|
const height = Math.max(3, players.length) * 40;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleResize = () => {
|
const handleResize = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user