Skip to content

Commit 8ba5fbb

Browse files
authored
Merge pull request linode#32 from linode/DLC-164
DLC-164 Add anchor link to changelog entries
2 parents 7f731ad + d36b477 commit 8ba5fbb

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

src/components/2_molecules/changelog-item.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import PropTypes from "prop-types";
33

4+
import Link from "../../images/svgs/link.svg";
5+
46
class ChangelogItem extends React.Component {
57
componentDidMount() {
68
const hash = document.location.hash;
@@ -11,7 +13,7 @@ class ChangelogItem extends React.Component {
1113
() =>
1214
document
1315
.getElementById(hash.substr(1))
14-
.scrollIntoView({ block: "start", behavior: "smooth" }),
16+
.scrollIntoView({ block: "start" }),
1517
50
1618
);
1719
}
@@ -52,7 +54,7 @@ class ChangelogItem extends React.Component {
5254
className="mt-0 text-2xl font-normal"
5355
itemProp="alternativeHeadline"
5456
>
55-
{title}
57+
<a href={`#${link}`} className="changelog-anchor-link"><Link /></a>{title}
5658
</h2>
5759
<div
5860
className="changelog-entry"

src/css/components/1_atoms/button.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
.btn[aria-current="page"] {
22
@apply bg-BaseBlue text-white;
33
}
4+
5+
.changelog-anchor-link svg {
6+
width: 22px;
7+
height: 22px;
8+
padding: 4px;
9+
margin-right: .5rem;
10+
position: relative;
11+
top: 3px;
12+
@apply rounded;
13+
}
14+
15+
.changelog-anchor-link svg:hover,
16+
.changelog-anchor-link svg:focus {
17+
@apply bg-grey text-white;
18+
}

src/css/components/2_molecules/changelog-entry.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
@apply my-4;
99
}
1010

11+
.changelog-entry ul p {
12+
@apply mt-0;
13+
}
14+
1115
.int-changelog .changelog-product {
1216
display: none;
1317
}

src/images/svgs/link.svg

Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)