11import React from "react" ;
2- import styled , { useTheme } from "styled-components" ;
3- import { useMeasure } from "react-use" ;
2+ import styled from "styled-components" ;
43import CourtOverview from "./CourtOverview" ;
54import LatestCases from "./LatestCases" ;
65import Community from "./Community" ;
6+ import Header from "./Header" ;
77import { HomePageProvider } from "hooks/useHomePageContext" ;
88import { getOneYearAgoTimestamp } from "utils/date" ;
9- import { BREAKPOINT_SMALL_SCREEN } from "styles/smallScreenStyle" ;
10- import HeaderLightMobile from "tsx:svgs/header/header-lightmode-mobile.svg" ;
11- import HeaderDarkMobile from "tsx:svgs/header/header-darkmode-mobile.svg" ;
12- import HeaderLightDesktop from "tsx:svgs/header/header-lightmode-desktop.svg" ;
13- import HeaderDarkDesktop from "tsx:svgs/header/header-darkmode-desktop.svg" ;
149
1510const Container = styled . div `
1611 width: 100%;
@@ -19,26 +14,6 @@ const Container = styled.div`
1914 padding: 32px;
2015` ;
2116
22- const Header = ( ) => {
23- const [ ref , { width } ] = useMeasure ( ) ;
24- const theme = useTheme ( ) ;
25- const themeIsLight = theme . name === "light" ;
26- const breakpointIsBig = width > BREAKPOINT_SMALL_SCREEN ;
27- return (
28- < div ref = { ref } >
29- { breakpointIsBig ? < HeaderDesktop themeIsLight = { themeIsLight } /> : < HeaderMobile themeIsLight = { themeIsLight } /> }
30- </ div >
31- ) ;
32- } ;
33-
34- const HeaderDesktop : React . FC < { themeIsLight : boolean } > = ( { themeIsLight } ) => {
35- return themeIsLight ? < HeaderLightDesktop /> : < HeaderDarkDesktop /> ;
36- } ;
37-
38- const HeaderMobile : React . FC < { themeIsLight : boolean } > = ( { themeIsLight } ) => {
39- return themeIsLight ? < HeaderLightMobile /> : < HeaderDarkMobile /> ;
40- } ;
41-
4217const Home : React . FC = ( ) => {
4318 return (
4419 < HomePageProvider timeframe = { getOneYearAgoTimestamp ( ) } >
0 commit comments