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