This repository was archived by the owner on Nov 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
core/gatsby-theme-docz/src Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import { Logo } from '../Logo'
88
99export const Header = props => {
1010 const { onOpen } = props
11- const config = useConfig ( )
11+ const {
12+ repository,
13+ themeConfig : { showDarkModeSwitch } ,
14+ } = useConfig ( )
1215 const { edit = true , ...doc } = useCurrentDoc ( )
1316 const [ colorMode , setColorMode ] = useColorMode ( )
1417
@@ -17,7 +20,7 @@ export const Header = props => {
1720 }
1821
1922 return (
20- < div sx = { styles . wrapper } data-testid = { ' header' } >
23+ < div sx = { styles . wrapper } data-testid = " header" >
2124 < Box sx = { styles . menuIcon } >
2225 < button sx = { styles . menuButton } onClick = { onOpen } >
2326 < Menu size = { 25 } />
@@ -26,10 +29,10 @@ export const Header = props => {
2629 < div sx = { styles . innerContainer } >
2730 < Logo />
2831 < Flex >
29- { config . repository && (
32+ { repository && (
3033 < Box sx = { { mr : 2 } } >
3134 < a
32- href = { config . repository }
35+ href = { repository }
3336 sx = { styles . headerButton }
3437 target = "_blank"
3538 rel = "noopener noreferrer"
@@ -38,9 +41,11 @@ export const Header = props => {
3841 </ a >
3942 </ Box >
4043 ) }
41- < button sx = { styles . headerButton } onClick = { toggleColorMode } >
42- < Sun size = { 15 } />
43- </ button >
44+ { showDarkModeSwitch && (
45+ < button sx = { styles . headerButton } onClick = { toggleColorMode } >
46+ < Sun size = { 15 } />
47+ </ button >
48+ ) }
4449 </ Flex >
4550 { edit && doc . link && (
4651 < a
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ export const wrapper = {
1111export const innerContainer = {
1212 ...mixins . centerAlign ,
1313 px : 4 ,
14- py : '24px' ,
1514 position : 'relative' ,
1615 justifyContent : 'space-between' ,
16+ height : 80 ,
1717}
1818
1919export const menuIcon = {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export default merge(typography, {
1414 showLiveError : true ,
1515 showLivePreview : true ,
1616 showPlaygroundEditor : true ,
17+ showDarkModeSwitch : true ,
1718 colors : {
1819 ...modes . light ,
1920 modes : {
You can’t perform that action at this time.
0 commit comments