File tree Expand file tree Collapse file tree 6 files changed +73
-3
lines changed Expand file tree Collapse file tree 6 files changed +73
-3
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Link } from 'react-router-dom' ;
3
+ import cx from 'classnames' ;
4
+ import { useTheme } from '../../../ThemeProvider' ;
3
5
import GithubButton from '../../GithubButton/GithubButton' ;
4
6
import logoText from '../../../assets/logo-text.svg' ;
7
+ import logoTextWhite from '../../../assets/logo-text-white.svg' ;
5
8
import classes from './Header.styles.less' ;
6
9
7
10
export default function Header ( ) {
11
+ const [ theme ] = useTheme ( ) ;
12
+
8
13
return (
9
- < header className = { classes . header } >
14
+ < header className = { cx ( classes . header , classes [ theme ] ) } >
10
15
< div className = { classes . headerBody } >
11
16
< Link to = "/" >
12
- < img className = { classes . logo } src = { logoText } alt = "" width = { 340 } height = { 72 } />
17
+ < img
18
+ className = { classes . logo }
19
+ src = { theme === 'light' ? logoText : logoTextWhite }
20
+ alt = ""
21
+ width = { 340 }
22
+ height = { 72 }
23
+ />
13
24
</ Link >
14
25
< p className = { classes . description } > Open source browser tools for everyday use</ p >
15
26
</ div >
Original file line number Diff line number Diff line change 29
29
margin-bottom : 18px ;
30
30
}
31
31
}
32
+
33
+ .dark {
34
+ border-bottom-color : @oc-gray-6 ;
35
+
36
+ .description {
37
+ color : @oc-gray-1 ;
38
+ }
39
+ }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
+ import cx from 'classnames' ;
4
+ import { useTheme } from '../../ThemeProvider' ;
3
5
import Footer from './Footer/Footer' ;
4
6
import Header from './Header/Header' ;
5
7
import classes from './PageBase.styles.less' ;
6
8
7
9
export default function PageBase ( { children } ) {
10
+ const [ theme ] = useTheme ( ) ;
11
+
8
12
return (
9
- < main className = { classes . wrapper } >
13
+ < main className = { cx ( classes . wrapper , classes [ theme ] ) } >
10
14
< div className = { classes . container } >
11
15
< Header />
12
16
{ children }
Original file line number Diff line number Diff line change 11
11
padding-left : 20px ;
12
12
padding-right : 20px ;
13
13
}
14
+
15
+ .dark {
16
+ background-color : @oc-gray-9 ;
17
+ }
You can’t perform that action at this time.
0 commit comments