1
1
import React from "react" ;
2
- import styled , { useTheme } from "styled-components" ;
3
- import { useMeasure } from "react-use" ;
2
+ import styled from "styled-components" ;
4
3
import CourtOverview from "./CourtOverview" ;
5
4
import LatestCases from "./LatestCases" ;
6
5
import Community from "./Community" ;
6
+ import Header from "./Header" ;
7
7
import { HomePageProvider } from "hooks/useHomePageContext" ;
8
8
import { 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" ;
14
9
15
10
const Container = styled . div `
16
11
width: 100%;
@@ -19,26 +14,6 @@ const Container = styled.div`
19
14
padding: 32px;
20
15
` ;
21
16
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
-
42
17
const Home : React . FC = ( ) => {
43
18
return (
44
19
< HomePageProvider timeframe = { getOneYearAgoTimestamp ( ) } >
0 commit comments