1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import DarkModeToggle from './DarkModeToggle' ;
4
+ import { GitHub , Edit } from 'react-feather' ;
4
5
5
6
import styles from './GlobalHeader.module.scss' ;
6
7
7
- const GlobalHeader = ( { hasHeaderBg, className } ) => {
8
+ const GlobalHeader = ( { hasHeaderBg, className, editLink } ) => {
8
9
return (
9
10
< div
10
11
className = { `${ styles . globalHeaderContainer } ${
@@ -47,18 +48,36 @@ const GlobalHeader = ({ hasHeaderBg, className }) => {
47
48
</ div >
48
49
49
50
< ul className = { styles . rightSideButtons } >
50
- < li className = { styles . darkModeToggle } >
51
- < DarkModeToggle />
51
+ < li
52
+ className = { `${ styles . rightSideButton } ${ styles . editPageButton } ` }
53
+ title = "Edit this page"
54
+ >
55
+ < a
56
+ href = { editLink }
57
+ className = { styles . editPageButtonLink }
58
+ target = "__blank"
59
+ >
60
+ < Edit color = "#000D0D" size = { 14 } className = { styles . editIcon } />
61
+ </ a >
52
62
</ li >
53
- < li className = { `${ styles . rightSideButton } ${ styles . githubButton } ` } >
63
+ < li
64
+ className = { `${ styles . rightSideButton } ${ styles . githubButton } ` }
65
+ title = "View the GitHub repo for this website"
66
+ >
54
67
< a
55
68
href = "https://github.com/newrelic/opensource-website"
56
69
className = { styles . githubButtonLink }
57
70
target = "__blank"
58
71
>
59
- GitHub
72
+ < GitHub color = "#000D0D" size = { 14 } className = { styles . githubIcon } />
60
73
</ a >
61
74
</ li >
75
+ < li
76
+ className = { `styles.darkModeToggle ${ styles . rightSideButton } ` }
77
+ title = "Toggle dark mode"
78
+ >
79
+ < DarkModeToggle />
80
+ </ li >
62
81
</ ul >
63
82
</ div >
64
83
</ div >
@@ -67,7 +86,8 @@ const GlobalHeader = ({ hasHeaderBg, className }) => {
67
86
68
87
GlobalHeader . propTypes = {
69
88
hasHeaderBg : PropTypes . bool ,
70
- className : PropTypes . string
89
+ className : PropTypes . string ,
90
+ editLink : PropTypes . string
71
91
} ;
72
92
73
93
export default GlobalHeader ;
0 commit comments