Skip to content

Commit 8e88761

Browse files
Mike Wicketthashicorp-ci
authored andcommitted
Merge pull request #8076 from hashicorp/nq.basic-hero-tertiary-link-support
[Website] Support tertiary-styled third links
1 parent 162e3b3 commit 8e88761

File tree

4 files changed

+62
-22
lines changed

4 files changed

+62
-22
lines changed
Lines changed: 1 addition & 0 deletions
Loading

website/components/basic-hero/index.jsx

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import Button from '@hashicorp/react-button'
2+
import InlineSvg from '@hashicorp/react-inline-svg'
3+
import RightArrowIcon from './img/right-arrow-icon.svg?include'
24

35
export default function BasicHero({
46
heading,
@@ -13,26 +15,41 @@ export default function BasicHero({
1315
<h1 className="g-type-display-1">{heading}</h1>
1416
{content && <p className="g-type-body-large">{content}</p>}
1517
{links && links.length > 0 && (
16-
<div className="links">
17-
{links.map((link, stableIdx) => {
18-
const buttonVariant = stableIdx === 0 ? 'primary' : 'secondary'
19-
const linkType = link.type || 'inbound'
20-
return (
21-
<Button
22-
// eslint-disable-next-line react/no-array-index-key
23-
key={stableIdx}
24-
linkType={linkType}
25-
theme={{
26-
variant: buttonVariant,
27-
brand,
28-
background: 'light',
29-
}}
30-
title={link.text}
31-
url={link.url}
32-
/>
33-
)
34-
})}
35-
</div>
18+
<>
19+
<div className="links">
20+
{links.slice(0, 2).map((link, stableIdx) => {
21+
const buttonVariant = stableIdx === 0 ? 'primary' : 'secondary'
22+
const linkType = link.type || 'inbound'
23+
24+
return (
25+
<Button
26+
// eslint-disable-next-line react/no-array-index-key
27+
key={stableIdx}
28+
linkType={linkType}
29+
theme={{
30+
variant: buttonVariant,
31+
brand,
32+
background: 'light',
33+
}}
34+
title={link.text}
35+
url={link.url}
36+
/>
37+
)
38+
})}
39+
</div>
40+
{links[2] && (
41+
<div className="third-link">
42+
<a href={links[2].url} rel="noopener" target="_blank">
43+
<span className="g-type-buttons-and-standalone-links">
44+
{links[2].text}
45+
</span>
46+
<span className="icon">
47+
<InlineSvg src={RightArrowIcon} />
48+
</span>
49+
</a>
50+
</div>
51+
)}
52+
</>
3653
)}
3754
</div>
3855
</div>

website/components/basic-hero/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@
4444
}
4545
}
4646

47+
& .third-link {
48+
display: flex;
49+
justify-content: center;
50+
margin-top: 32px;
51+
52+
& a {
53+
display: flex;
54+
align-items: center;
55+
color: var(--gray-4);
56+
57+
& .icon {
58+
margin-left: 8px;
59+
height: 24px;
60+
}
61+
}
62+
}
63+
4764
&.has-background {
4865
background-repeat: no-repeat;
4966
background-color: var(--gray-7);

website/pages/home/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ export default function HomePage() {
1414
heading="Service Networking Across Any Cloud"
1515
content="Automate network configurations, discover services, and enable secure connectivity across any cloud or runtime."
1616
links={[
17+
{
18+
text: 'Get Started',
19+
url: 'https://learn.hashicorp.com/consul',
20+
type: 'outbound',
21+
},
1722
{
1823
text: 'Download',
1924
url: '/downloads',
2025
type: 'download',
2126
},
2227
{
23-
text: 'Get Started',
24-
url: 'https://learn.hashicorp.com/consul',
28+
text: 'Try HasiCorp Consul Service on Azure',
29+
url: 'https://learn.hashicorp.com/consul/hcs-azure/deploy',
2530
type: 'outbound',
2631
},
2732
]}

0 commit comments

Comments
 (0)