Skip to content

Commit 8e914f7

Browse files
committed
Added a GitHub button in the app bar linking to the repo
1 parent 6cb7c24 commit 8e914f7

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/ButtonAppBar.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import ZoomOutIcon from '@material-ui/icons/ZoomOut';
1212
import ZoomOutMapIcon from '@material-ui/icons/ZoomOutMap';
1313
import SettingsIcon from '@material-ui/icons/Settings';
1414
import HelpIcon from '@material-ui/icons/Help';
15+
import GitHubIcon from './GitHubIcon'
1516

1617
const styles = {
1718
root: {
@@ -24,6 +25,12 @@ const styles = {
2425
marginLeft: -12,
2526
marginRight: 20,
2627
},
28+
gitHubLink: {
29+
color: 'inherit',
30+
'&:visited' : {
31+
color: 'inherit',
32+
},
33+
},
2734
};
2835

2936
function ButtonAppBar(props) {
@@ -145,6 +152,22 @@ function ButtonAppBar(props) {
145152
>
146153
<SettingsIcon />
147154
</IconButton>
155+
<a
156+
className={classes.gitHubLink}
157+
href="https://github.com/magjac/graphviz-visual-editor"
158+
target="_blank"
159+
rel="noreferrer noopener"
160+
>
161+
<IconButton
162+
color="inherit"
163+
aria-label="GitHub"
164+
>
165+
<GitHubIcon
166+
fontSize='inherit'
167+
viewBox='-2.4 -2.4 28.8 28.8'
168+
/>
169+
</IconButton>
170+
</a>
148171
<IconButton
149172
color="inherit"
150173
aria-label="Help"

src/GitHubIcon.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import SvgIcon from '@material-ui/core/SvgIcon';
3+
4+
function GitHubIcon(props) {
5+
return (
6+
<SvgIcon {...props}>
7+
<path d="M12.007 0C6.12 0 1.1 4.27.157 10.08c-.944 5.813 2.468 11.45 8.054 13.312.19.064.397.033.555-.084.16-.117.25-.304.244-.5v-2.042c-3.33.735-4.037-1.56-4.037-1.56-.22-.726-.694-1.35-1.334-1.756-1.096-.75.074-.735.074-.735.773.103 1.454.557 1.846 1.23.694 1.21 2.23 1.638 3.45.96.056-.61.327-1.178.766-1.605-2.67-.3-5.462-1.335-5.462-6.002-.02-1.193.42-2.35 1.23-3.226-.327-1.015-.27-2.116.166-3.09 0 0 1.006-.33 3.3 1.23 1.966-.538 4.04-.538 6.003 0 2.295-1.5 3.3-1.23 3.3-1.23.445 1.006.49 2.144.12 3.18.81.877 1.25 2.033 1.23 3.226 0 4.607-2.805 5.627-5.476 5.927.578.583.88 1.386.825 2.206v3.29c-.005.2.092.393.26.507.164.115.377.14.565.063 5.568-1.88 8.956-7.514 8.007-13.313C22.892 4.267 17.884.007 12.008 0z" />
8+
</SvgIcon>
9+
);
10+
}
11+
12+
export default GitHubIcon;

0 commit comments

Comments
 (0)