File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
web-app/src/containers/Tutorial/components Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -39,23 +39,22 @@ type Props = {
3939}
4040
4141const Level = ( { level } : Props ) => {
42- const pageBottomRef = React . useRef ( null )
43- const scrollToBottom = ( ) => {
42+ const pageTopRef = React . useRef ( null )
43+ const scrollToTop = ( ) => {
4444 // @ts -ignore
45- pageBottomRef . current . scrollIntoView ( { behavior : 'smooth' } )
45+ pageTopRef . current . scrollIntoView ( { behavior : 'smooth' } )
4646 }
47- React . useEffect ( scrollToBottom , [ level . id ] )
47+ React . useEffect ( scrollToTop , [ level . id ] )
4848
4949 return (
5050 < div css = { styles . page } >
51+ < div ref = { pageTopRef } />
5152 < div css = { styles . content } >
5253 < Content title = { level . title } content = { level . content } />
5354
5455 { level . content . length && level . steps . length ? < div css = { styles . separator } /> : null }
5556
5657 < Steps steps = { level . steps } />
57-
58- < div ref = { pageBottomRef } />
5958 </ div >
6059 </ div >
6160 )
You can’t perform that action at this time.
0 commit comments