@@ -4,6 +4,7 @@ import { Button } from '../../button'
44import { FiUpload } from 'react-icons/fi'
55import Tournament , { JsonTournamentGame } from '../../../playback/Tournament'
66import { NumInput } from '../../forms'
7+ import { BsLock , BsUnlock } from 'react-icons/bs'
78
89interface TournamentPageProps {
910 open : boolean
@@ -13,7 +14,10 @@ export const TournamentPage: React.FC<TournamentPageProps> = ({ open }) => {
1314 const context = useAppContext ( )
1415 const inputRef = React . useRef < HTMLInputElement | null > ( )
1516
17+ const [ locked , setLocked ] = React . useState ( false )
18+
1619 const updateMinRound = ( val : number ) => {
20+ if ( locked ) return
1721 context . setState ( ( prevState ) => ( { ...prevState , tournamentMinRound : val } ) )
1822 }
1923
@@ -51,14 +55,25 @@ export const TournamentPage: React.FC<TournamentPageProps> = ({ open }) => {
5155 < span >
5256 < b > Participants:</ b > { tournament . participantCount }
5357 </ span >
54- < span className = "mt-[-3px]" >
58+ < span className = "flex items-center mt-[-3px]" >
5559 < b className = "mr-2" > Starting Round:</ b >
5660 < NumInput
61+ disabled = { locked }
5762 value = { context . state . tournamentMinRound }
5863 changeValue = { updateMinRound }
5964 min = { 1 }
6065 max = { tournament . maxRound }
6166 />
67+ < button
68+ className = "ml-1 hover:bg-lightHighlight p-[0.2rem] rounded-md"
69+ onClick = { ( ) => setLocked ( ! locked ) }
70+ >
71+ { locked ? (
72+ < BsLock className = "w-[15px] h-[15px]" />
73+ ) : (
74+ < BsUnlock className = "w-[15px] h-[15px]" />
75+ ) }
76+ </ button >
6277 </ span >
6378 </ div >
6479 ) }
0 commit comments