@@ -7,11 +7,13 @@ function CustomDeriv() {
77 const container = useRef < HTMLDivElement > ( null ) ;
88 const MQ = useRef < any > ( null ) ;
99 const containerMF = useRef < any > ( null ) ;
10+ const start = useRef < HTMLDivElement > ( null ) ;
1011
1112 const edit = useRef < HTMLDivElement > ( null ) ;
1213 const editMF = useRef < any > ( null ) ;
1314 const [ func , setFunc ] = useState < string > ( '' ) ;
1415 const [ bounds , setBounds ] = useState < number [ ] > ( [ 0 , 5 ] ) ;
16+ const [ formatCheck , setFormatCheck ] = useState < string > ( '' ) ;
1517
1618 /*
1719 Updates the function and the bounds with the user input
@@ -26,7 +28,7 @@ function CustomDeriv() {
2628 newFunc = generateFunction ( funcLatex )
2729 }
2830 catch {
29- console . log ( 'Please enter a valid function' )
31+ setFormatCheck ( 'Please enter a valid function' )
3032 return 1
3133 }
3234
@@ -37,13 +39,15 @@ function CustomDeriv() {
3739
3840 // check if bounds are valid
3941 if ( checkBounds !== 'success' ) {
40- console . log ( checkBounds )
42+ setFormatCheck ( checkBounds )
4143 return 1
4244 }
4345
4446 // input is valid, so set all variables
4547 setFunc ( newFunc )
4648 setBounds ( [ parseFloat ( lowerBound ) , parseFloat ( upperBound ) ] )
49+ setFormatCheck ( '' )
50+
4751
4852 return 0
4953 }
@@ -55,10 +59,10 @@ function CustomDeriv() {
5559
5660 containerMF . current = MQ . current . StaticMath ( container . current , { } ) // for the bounds
5761
58- editMF . current = MQ . current . StaticMath ( edit . current ) . innerFields [ 0 ] // for the function
62+ MQ . current . StaticMath ( start . current , { } ) // for the y =
5963
6064 // updates the output whenever 'enter' is pressed
61- editMF . current . config ( {
65+ editMF . current = MQ . current . MathField ( edit . current , {
6266 handlers : {
6367 enter : generateOutput
6468 }
@@ -73,23 +77,25 @@ function CustomDeriv() {
7377 < button className = "back-button" > Back</ button >
7478 </ Link >
7579
76- < div className = "center-header flex flex-wrap justify-center gap-[1rem]" >
80+ < div className = "center-header flex flex-wrap justify-center gap-[1rem]" style = { { alignItems : "center" } } >
7781 < div ref = { container } >
7882 \MathQuillMathField{0} \leq x \leq \MathQuillMathField{5}
7983 </ div >
8084
81- < div ref = { edit } >
82- y = \MathQuillMathField{x}
85+ < div >
86+ < div ref = { start } >
87+ y =
88+ </ div >
89+
90+ < div ref = { edit } className = "edit-box" >
91+ x
92+ </ div >
8393 </ div >
8494
8595 </ div >
8696
87- < div style = { { display :'block' , marginBottom :'0.5rem' } } className = 'center-header' >
88- { func } { bounds . join ( ', ' ) }
89- </ div >
90-
91- < div className = "graph-outer-box" style = { { justifyContent : "center" } } >
92- The graph will go here
97+ < div className = "center-header" style = { { fontSize :'1.5rem' } } >
98+ Coming Soon
9399 </ div >
94100
95101 </ div >
0 commit comments