File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -63,16 +63,21 @@ export const Welcome = () => {
6363 < LearnmoreBtn
6464 variant = "contained"
6565 onClick = { ( ) => {
66- document
67- . querySelector ( ".STEPS" )
68- . scrollIntoView ( { behavior : "smooth" } ) ;
66+ const offset = document . querySelector ( ".header" ) . clientHeight ;
67+ window . scrollTo ( {
68+ behavior : "smooth" ,
69+ top :
70+ document . querySelector ( ".STEPS" ) . getBoundingClientRect ( ) . top -
71+ document . body . getBoundingClientRect ( ) . top -
72+ offset ,
73+ } ) ;
6974 } }
7075 >
7176 learn more
7277 </ LearnmoreBtn >
7378 </ Stack >
7479 </ InfoDiv >
75- < ImgDiv { ... zoominItem } >
80+ < ImgDiv { ...zoominItem } >
7681 < MainImg src = { MAIN } />
7782 </ ImgDiv >
7883 </ StWelcome >
Original file line number Diff line number Diff line change 11import styled from "styled-components" ;
22import { COLOR } from "../styles/color" ;
3- import React , { useState } from "react" ;
3+ import React , { useRef , useState } from "react" ;
44import PropTypes from "prop-types" ;
55import { useRecoilState , useSetRecoilState } from "recoil" ;
66import { avatar , id , name , isLogin } from "../recoil/authorize" ;
@@ -58,6 +58,7 @@ export async function checkTokenValid() {
5858}
5959
6060export const Header = ( props ) => {
61+ const headerRef = useRef ( ) ;
6162 const [ anchorElNav , setAnchorElNav ] = useState ( null ) ;
6263 const [ anchorElUser , setAnchorElUser ] = useState ( null ) ;
6364 const [ src , setSrc ] = useRecoilState ( avatar ) ;
@@ -123,7 +124,7 @@ export const Header = (props) => {
123124 < React . Fragment >
124125 < CssBaseline />
125126 < ElevationScroll { ...props } >
126- < AppBar style = { { background : COLOR . MAIN_WHITE } } >
127+ < AppBar className = "header" style = { { background : COLOR . MAIN_WHITE } } >
127128 < Toolbar >
128129 < Box
129130 sx = { {
You can’t perform that action at this time.
0 commit comments