@@ -45,7 +45,6 @@ const Profile = (): JSX.Element => {
4545 confirmPassword : 'password' ,
4646 } ) ;
4747 const err = useAppSelector ( isCreditionalError ) ;
48- const profileScrollRef = useRef < HTMLDivElement > ( null ) ;
4948 const oldpasswordTypeAction = ( ) => {
5049 if ( passwordType . oldpassword === 'password' ) {
5150 setPasswordType ( {
@@ -197,6 +196,8 @@ const Profile = (): JSX.Element => {
197196 setSelectedAvatar ( id ) ;
198197 } ;
199198
199+ const profileScrollRef = useRef < HTMLDivElement > ( null ) ;
200+
200201 const handleGoToCreds = ( ) => {
201202 if ( profileScrollRef . current ) {
202203 profileScrollRef . current . scrollTo ( {
@@ -215,6 +216,15 @@ const Profile = (): JSX.Element => {
215216 }
216217 } ;
217218
219+ const handleGoToRatingChart = ( ) => {
220+ if ( profileScrollRef . current ) {
221+ profileScrollRef . current . scrollTo ( {
222+ top : 1900 ,
223+ behavior : 'smooth' ,
224+ } ) ;
225+ }
226+ } ;
227+
218228 return (
219229 < div
220230 className = { styles . profileScrollBody }
@@ -241,7 +251,7 @@ const Profile = (): JSX.Element => {
241251 className = { classnames ( 'mb-4' , styles . formField ) }
242252 controlId = "formBasicUserName"
243253 >
244- < Form . Label className = { styles . label } > USERNAME </ Form . Label >
254+ < Form . Label className = { styles . label } > NAME </ Form . Label >
245255 < Form . Control
246256 type = "text"
247257 placeholder = { loggedInUser . name || 'Full Name' }
@@ -331,20 +341,16 @@ const Profile = (): JSX.Element => {
331341 </ Button >
332342 </ div >
333343 < div className = { styles . footer } >
334- {
335- < >
336- < Button
337- variant = "link"
338- onClick = { ( ) => {
339- handleGoToCreds ( ) ;
340- dispatch ( creditionals ( ) ) ;
341- } }
342- className = { styles . linkButton }
343- >
344- { 'CHANGE CREDENTIALS ' }
345- </ Button >
346- </ >
347- }
344+ < Button
345+ variant = "link"
346+ onClick = { ( ) => {
347+ handleGoToCreds ( ) ;
348+ dispatch ( creditionals ( ) ) ;
349+ } }
350+ className = { styles . linkButton }
351+ >
352+ { 'CHANGE CREDENTIALS ' }
353+ </ Button >
348354 </ div >
349355 </ div >
350356 < div >
@@ -459,23 +465,39 @@ const Profile = (): JSX.Element => {
459465 SUBMIT{ ' ' }
460466 </ Button >
461467 </ div >
468+ < div className = { styles . footer } >
469+ < Button
470+ variant = "link"
471+ onClick = { handleGoBacktoProfile }
472+ className = { styles . linkButton }
473+ >
474+ { ' EDIT PROFILE' }
475+ </ Button >
476+ < Button
477+ variant = "link"
478+ onClick = { handleGoToRatingChart }
479+ className = { styles . linkButton }
480+ >
481+ { ' RATING CHART' }
482+ </ Button >
483+ </ div >
462484 </ div >
463485 </ Form >
486+ < RatingChart />
464487 < div className = { styles . footer } >
465488 < Button
466489 variant = "link"
467- onClick = { handleGoBacktoProfile }
490+ onClick = { ( ) => {
491+ handleGoToCreds ( ) ;
492+ dispatch ( creditionals ( ) ) ;
493+ } }
468494 className = { styles . linkButton }
469495 >
470- { ' EDIT PROFILE ' }
496+ { 'CHANGE CREDENTIALS ' }
471497 </ Button >
472498 </ div >
473499 </ div >
474500 </ div >
475- < div >
476- < RatingChart />
477- < div className = { styles . emptyspace } > </ div >
478- </ div >
479501 </ div >
480502 ) ;
481503} ;
0 commit comments