@@ -29,11 +29,19 @@ const renderRows = data => {
2929 < tbody >
3030 { Object . keys ( operationData ) . map ( complexity => (
3131 < tr key = { complexity } >
32- < td style = { { width : '13 %' } } >
32+ < td style = { { width : '15 %' } } >
3333 { complexity [ 0 ] . toUpperCase ( ) + complexity . slice ( 1 ) }
3434 </ td >
35- < ToggleBlurCell text = { operationData [ complexity ] . big_o } />
36- < td > { applyEquationClass ( operationData [ complexity ] . explanation ) } </ td >
35+ < ToggleBlurCell
36+ text = { operationData [ complexity ] . big_o }
37+ width = { '25%' }
38+ force = { true }
39+ />
40+ < ToggleBlurCell
41+ text = { operationData [ complexity ] . explanation }
42+ width = { '60%' }
43+ force = { false }
44+ />
3745 </ tr >
3846 ) ) }
3947 </ tbody >
@@ -43,20 +51,16 @@ const renderRows = data => {
4351 } ) ;
4452} ;
4553
46- const ToggleBlurCell = ( { text } ) => {
54+ const ToggleBlurCell = ( { text, width , force } ) => {
4755 const [ isBlurred , setIsBlurred ] = useState ( true ) ;
4856
49- const handleMouseEnter = ( ) => {
50- setIsBlurred ( false ) ;
51- } ;
52-
5357 return (
5458 < td
55- style = { { width : '16%' } }
59+ style = { { width : width } }
5660 className = { isBlurred ? 'blur big_o_cell' : 'big_o_cell' }
57- onMouseEnter = { handleMouseEnter }
61+ onClick = { ( ) => isBlurred ? setIsBlurred ( false ) : setIsBlurred ( true ) }
5862 >
59- { applyEquationClass ( text , true ) }
63+ { applyEquationClass ( text , force ) }
6064 </ td >
6165 ) ;
6266} ;
@@ -86,6 +90,7 @@ const Modals = page => {
8690 < div className = "button-container" >
8791 < button onClick = { toggleBlur } > Reveal All Big-O</ button >
8892 </ div >
93+ < text > Click to reveal answer </ text >
8994 { renderRows ( timeComplexities [ page ] ) }
9095 </ div >
9196 ) : null ;
0 commit comments