File tree Expand file tree Collapse file tree 2 files changed +1
-18
lines changed
Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change 1- const _ = require ( `lodash` ) ;
21const path = require ( `path` ) ;
32const { slash } = require ( `gatsby-core-utils` ) ;
43const { createFilePath } = require ( `gatsby-source-filesystem` ) ;
Original file line number Diff line number Diff line change @@ -15,27 +15,11 @@ function ContributorDetails(props) {
1515 const isDesktop = useMediaQuery ( theme . breakpoints . up ( 'lg' ) ) ;
1616 const isTablet = useMediaQuery ( theme . breakpoints . between ( 'lg' , 'sm' ) ) ;
1717 const isMobile = useMediaQuery ( theme . breakpoints . down ( 'sm' ) ) ;
18+ const darkmode = useMediaQuery ( '(prefers-color-scheme: dark)' ) ;
1819 const title =
1920 props . data . asciidoc . pageAttributes . name +
2021 ' - Jenkins Contributor Spotlight' ;
2122 const { previous, next } = props . pageContext ;
22- const [ darkmode , setDarkmode ] = React . useState ( null ) ;
23-
24- useEffect ( ( ) => {
25- if ( typeof window !== 'undefined' ) {
26- const mediaquery =
27- window . matchMedia &&
28- window . matchMedia ( '(prefers-color-scheme: dark)' ) ;
29- setDarkmode ( mediaquery . matches ) ;
30- const handler = ( event ) => {
31- setDarkmode ( event . matches ) ;
32- } ;
33- mediaquery . addEventListener ( 'change' , handler ) ;
34- return ( ) => {
35- mediaquery . removeEventListener ( 'change' , handler ) ;
36- } ;
37- }
38- } , [ ] ) ;
3923
4024 // State for sanitized HTML
4125 const [ sanitizedHTML , setSanitizedHTML ] = useState (
You can’t perform that action at this time.
0 commit comments