File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ interface Props {
1414 goToRootNode : ( ) => void
1515 gameTree : GameTree
1616 setCurrentMove ?: ( move : [ string , string ] | null ) => void
17+ disableFlip ?: boolean
1718}
1819
1920export const BoardController : React . FC < Props > = ( {
@@ -27,6 +28,7 @@ export const BoardController: React.FC<Props> = ({
2728 goToRootNode,
2829 gameTree,
2930 setCurrentMove,
31+ disableFlip = false ,
3032} : Props ) => {
3133 const { width } = useWindowSize ( )
3234
@@ -97,7 +99,7 @@ export const BoardController: React.FC<Props> = ({
9799 if ( hasPrevious ) getFirst ( )
98100 break
99101 case 'f' :
100- toggleBoardOrientation ( )
102+ if ( ! disableFlip ) toggleBoardOrientation ( )
101103 break
102104 default :
103105 }
@@ -119,7 +121,8 @@ export const BoardController: React.FC<Props> = ({
119121 return (
120122 < div className = "flex w-full flex-row items-center gap-[1px] md:rounded" >
121123 < button
122- onClick = { toggleBoardOrientation }
124+ onClick = { disableFlip ? undefined : toggleBoardOrientation }
125+ disabled = { disableFlip }
123126 className = "flex h-7 flex-1 items-center justify-center bg-button-secondary transition duration-200 hover:bg-human-3 disabled:bg-button-secondary/40 md:rounded-sm"
124127 >
125128 { FlipIcon }
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ export const OpeningDrillSidebar: React.FC<Props> = ({
197197 goToNextNode = { goToNextNode }
198198 goToPreviousNode = { goToPreviousNode }
199199 goToRootNode = { goToRootNode }
200+ disableFlip = { true }
200201 />
201202 </ div >
202203 </ div >
You can’t perform that action at this time.
0 commit comments