1- import React from "react" ;
1+ import React , { useRef , useEffect , useState } from "react" ;
2+ import ReactDOM from "react-dom" ;
23import { Routes , Route , Navigate } from "react-router-dom" ;
34import Footer from "../Footer" ;
45import Header from "../Header" ;
@@ -18,47 +19,62 @@ import About from "../About";
1819import Community from "../Community" ;
1920
2021export default function App ( ) {
22+ const headerRef = useRef ( null ) ;
23+ const [ headerHeight , setHeaderHeight ] = useState ( 0 ) ;
24+
25+ useEffect ( ( ) => {
26+ if ( headerRef ?. current ) {
27+ const element = ReactDOM . findDOMNode ( headerRef ?. current ) ;
28+ if ( element instanceof Element ) {
29+ const height = element ?. getBoundingClientRect ( ) . height ;
30+ setHeaderHeight ( height ) ;
31+ }
32+ }
33+ } , [ ] ) ;
34+
2135 return (
2236 < >
23- < Header />
24- < Routes >
25- < Route path = "/" element = { < Landing /> } />
26- < Route
27- path = "/oeci"
28- element = {
29- < OeciLogin
30- userId = ""
31- password = ""
32- missingUserId = { false }
33- missingPassword = { false }
34- expectedFailure = { false }
35- expectedFailureMessage = ""
36- invalidResponse = { false }
37- missingInputs = { false }
38- isLoggedIn = { false }
39- />
40- }
41- />
42- < Route path = "/record-search" element = { < RecordSearch /> } />
43- < Route path = "/demo-record-search" element = { < Demo /> } />
44- < Route path = "/manual" element = { < Manual /> } />
45- < Route path = "/rules" element = { < Rules /> } />
46- < Route path = "/faq" element = { < Faq /> } />
47- < Route path = "/appendix" element = { < Appendix /> } />
48- < Route path = "/privacy-policy" element = { < PrivacyPolicy /> } />
49- < Route path = "/fill-expungement-forms" element = { < FillForms /> } />
50- < Route
51- path = "/partner-interest"
52- element = { < PartnerInterest email = "" invalidEmail = { true } /> }
53- />
54- < Route
55- path = "/accessibility-statement"
56- element = { < AccessibilityStatement /> }
57- />
58- < Route path = "/about" element = { < About /> } />
59- < Route path = "/community" element = { < Community /> } />
60- < Route path = "*" element = { < Navigate to = "/" /> } />
61- </ Routes >
37+ < Header ref = { headerRef } />
38+ < div style = { { marginTop : `${ headerHeight } px` } } >
39+ < Routes >
40+ < Route path = "/" element = { < Landing /> } />
41+ < Route
42+ path = "/oeci"
43+ element = {
44+ < OeciLogin
45+ userId = ""
46+ password = ""
47+ missingUserId = { false }
48+ missingPassword = { false }
49+ expectedFailure = { false }
50+ expectedFailureMessage = ""
51+ invalidResponse = { false }
52+ missingInputs = { false }
53+ isLoggedIn = { false }
54+ />
55+ }
56+ />
57+ < Route path = "/record-search" element = { < RecordSearch /> } />
58+ < Route path = "/demo-record-search" element = { < Demo /> } />
59+ < Route path = "/manual" element = { < Manual /> } />
60+ < Route path = "/rules" element = { < Rules /> } />
61+ < Route path = "/faq" element = { < Faq /> } />
62+ < Route path = "/appendix" element = { < Appendix /> } />
63+ < Route path = "/privacy-policy" element = { < PrivacyPolicy /> } />
64+ < Route path = "/fill-expungement-forms" element = { < FillForms /> } />
65+ < Route
66+ path = "/partner-interest"
67+ element = { < PartnerInterest email = "" invalidEmail = { true } /> }
68+ />
69+ < Route
70+ path = "/accessibility-statement"
71+ element = { < AccessibilityStatement /> }
72+ />
73+ < Route path = "/about" element = { < About /> } />
74+ < Route path = "/community" element = { < Community /> } />
75+ < Route path = "*" element = { < Navigate to = "/" /> } />
76+ </ Routes >
77+ </ div >
6278 < Footer />
6379 </ >
6480 ) ;
0 commit comments