11import React from 'react'
2- import { Box , ThemeProvider } from '@primer/react'
2+ import { Box } from '@primer/react'
33import styled from 'styled-components'
44import MobileSearch from './mobile-search'
55import NavDrawer from './nav-drawer'
66import Search from './search'
77import Link from './link'
88import useSearch from '../hooks/use-search'
9- import { HEADER_HEIGHT , HEADER_BAR , NPM_RED } from '../constants'
9+ import { HEADER_HEIGHT , HEADER_BAR } from '../constants'
1010import useSiteMetadata from '../hooks/use-site-metadata'
1111import headerNavItems from '../../content/header-nav.yml'
12+ import { DarkTheme } from '../theme'
1213
1314const NpmHeaderBar = styled ( Box ) `
1415 height: ${ HEADER_BAR } px;
1516 background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
1617`
1718
18- const NpmLogo = ( { size, ...props } ) => (
19- < Box { ...props } role = "banner" >
20- < svg
21- height = { size }
22- width = { size }
23- viewBox = "0 0 700 700"
24- fill = "currentColor"
25- style = { { color : NPM_RED } }
26- aria-hidden = "true"
27- >
28- < polygon fill = { NPM_RED } points = "0,700 700,700 700,0 0,0" />
19+ const NpmLogo = ( { size, sx} ) => (
20+ < Box sx = { { ...sx , color : 'logoBg' } } role = "banner" >
21+ < svg height = { size } width = { size } viewBox = "0 0 700 700" fill = "currentColor" aria-hidden = "true" >
22+ < polygon fill = "currentColor" points = "0,700 700,700 700,0 0,0" />
2923 < polygon fill = "#ffffff" points = "150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150 " />
3024 </ svg >
3125 </ Box >
@@ -36,7 +30,7 @@ function Header() {
3630 const search = useSearch ( )
3731
3832 return (
39- < ThemeProvider colorMode = "night" nightScheme = "dark_dimmed" >
33+ < DarkTheme >
4034 < Box sx = { { top : 0 , position : 'sticky' , zIndex : 1 } } >
4135 < NpmHeaderBar />
4236 < Box
@@ -87,7 +81,7 @@ function Header() {
8781 </ Box >
8882 </ Box >
8983 </ Box >
90- </ ThemeProvider >
84+ </ DarkTheme >
9185 )
9286}
9387
0 commit comments