Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb599b1

Browse files
saidaSaida Wijpkema
and
Saida Wijpkema
authored
Fix the anchor links in changelog (Hacker0x01#174)
Co-authored-by: Saida Wijpkema <[email protected]>
1 parent 09dec94 commit bb599b1

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/components/article/article.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import Helmet from "react-helmet";
3-
import { Link, withPrefix } from "gatsby-link";
3+
import { withPrefix } from "gatsby-link";
44
import GatsbyConfig from "../../../gatsby-config";
55

66
import Sidebar from "../../components/sidebar/sidebar";
@@ -13,7 +13,7 @@ const findActiveSectionByPath = (pathname, sections) => {
1313
let activeSection;
1414

1515
sections.forEach(section => {
16-
const match = section.items.some(
16+
match = section.items.some(
1717
item =>
1818
pathname === withPrefix(item.path) ||
1919
(item.items &&

src/pages/changelog/changelog.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
.changelog__wrapper {
1010
border-top: 1px solid $daisy-whisper;
1111
padding-top: 24px;
12-
position: relative;
1312
}
1413

1514
.changelog__anchor {
16-
position: absolute;
17-
top: -60px;
15+
position: relative;
16+
top: -18px;
1817
left: 0;
1918
height: 1px;
2019
width: 1px;

src/pages/changelog/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import Helmet from "react-helmet";
3-
import Link from "gatsby-link";
43
import slugify from "slugify";
54
import GatsbyConfig from "../../../gatsby-config";
65
import { graphql } from "gatsby";
@@ -20,7 +19,7 @@ class IndexRoute extends React.Component {
2019
<ul className="sidebar__items sidebar__items--active">
2120
{edges.map((item, index) => {
2221
return (
23-
<li className="sidebar__item">
22+
<li className="sidebar__item" key={index}>
2423
<a href={`#${slugify(item.node.frontmatter.path)}`}>
2524
{item.node.frontmatter.title}
2625
</a>
@@ -37,7 +36,7 @@ class IndexRoute extends React.Component {
3736
<p>See what's changed or new in HackerOne.</p>
3837
{edges.map((item, index) => {
3938
return (
40-
<div className="changelog__wrapper">
39+
<div className="changelog__wrapper" key={index}>
4140
<div
4241
className="changelog__anchor"
4342
id={slugify(item.node.frontmatter.path)}

src/pages/programs/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import Link from "gatsby-link";
32
import { graphql } from "gatsby";
43
import Article from "../../components/article/article";
54

0 commit comments

Comments
 (0)