Skip to content

Commit 3f2bb0f

Browse files
committed
github button is working
1 parent a64d830 commit 3f2bb0f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/components/buttons/GithubButtton.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import PropTypes from "prop-types"
22
import React from "react"
33
import Github from "../../assets/github_black.svg"
4-
const GithubButton = ({ children, className, onClick }) => (
5-
<button className={`${className} cursor-pointer `} onClick={onClick}>
4+
const GithubButton = ({ children, className, href }) => (
5+
<a
6+
className={`${className} cursor-pointer `}
7+
target="_blank"
8+
rel="noopener noreferrer"
9+
href={href}
10+
>
611
<span className="flex flex-row">
712
{children} <img src={Github} alt="framework" className="w-6 ml-2" />
813
</span>
9-
</button>
14+
</a>
1015
)
1116

1217
GithubButton.propTypes = {
1318
children: PropTypes.string,
1419
className: PropTypes.string,
15-
onClick: PropTypes.func,
20+
href: PropTypes.string,
1621
}
1722

1823
GithubButton.defaultProps = {

src/templates/post.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export default function Template({ data, pageContext }) {
2727
<SideChapterBox collapse />
2828
</div>
2929

30-
<GithubButton>Open an issue</GithubButton>
3130
<div className="mt-10">
3231
<ul className="flex justify-between">
3332
<li>
@@ -39,6 +38,10 @@ export default function Template({ data, pageContext }) {
3938
</Link>
4039
)}
4140
</li>
41+
<GithubButton href="https://github.com/Fullstack-Serverless-GraphQL/fullstack-serverless-graphql-docs/issues/new">
42+
Open an issue
43+
</GithubButton>
44+
4245
<li className="ml-20">
4346
{previous && (
4447
<Link to={previous.node.frontmatter.path}>

0 commit comments

Comments
 (0)