Merge pull request #8076 from hashicorp/nq.basic-hero-tertiary-link-support

[Website] Support tertiary-styled third links
This commit is contained in:
Mike Wickett 2020-06-10 10:47:40 -04:00 committed by GitHub
commit 61848c6187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 22 deletions

View File

@ -0,0 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 12l-6 6M4 12h16H4zm16 0l-6-6 6 6z" stroke="#76767D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 234 B

View File

@ -1,4 +1,6 @@
import Button from '@hashicorp/react-button' import Button from '@hashicorp/react-button'
import InlineSvg from '@hashicorp/react-inline-svg'
import RightArrowIcon from './img/right-arrow-icon.svg?include'
export default function BasicHero({ export default function BasicHero({
heading, heading,
@ -13,26 +15,41 @@ export default function BasicHero({
<h1 className="g-type-display-1">{heading}</h1> <h1 className="g-type-display-1">{heading}</h1>
{content && <p className="g-type-body-large">{content}</p>} {content && <p className="g-type-body-large">{content}</p>}
{links && links.length > 0 && ( {links && links.length > 0 && (
<div className="links"> <>
{links.map((link, stableIdx) => { <div className="links">
const buttonVariant = stableIdx === 0 ? 'primary' : 'secondary' {links.slice(0, 2).map((link, stableIdx) => {
const linkType = link.type || 'inbound' const buttonVariant = stableIdx === 0 ? 'primary' : 'secondary'
return ( const linkType = link.type || 'inbound'
<Button
// eslint-disable-next-line react/no-array-index-key return (
key={stableIdx} <Button
linkType={linkType} // eslint-disable-next-line react/no-array-index-key
theme={{ key={stableIdx}
variant: buttonVariant, linkType={linkType}
brand, theme={{
background: 'light', variant: buttonVariant,
}} brand,
title={link.text} background: 'light',
url={link.url} }}
/> title={link.text}
) url={link.url}
})} />
</div> )
})}
</div>
{links[2] && (
<div className="third-link">
<a href={links[2].url} rel="noopener" target="_blank">
<span className="g-type-buttons-and-standalone-links">
{links[2].text}
</span>
<span className="icon">
<InlineSvg src={RightArrowIcon} />
</span>
</a>
</div>
)}
</>
)} )}
</div> </div>
</div> </div>

View File

@ -45,6 +45,23 @@
} }
} }
& .third-link {
display: flex;
justify-content: center;
margin-top: 32px;
& a {
display: flex;
align-items: center;
color: var(--gray-4);
& .icon {
margin-left: 8px;
height: 24px;
}
}
}
&.has-background { &.has-background {
background-repeat: no-repeat; background-repeat: no-repeat;
background-color: var(--gray-7); background-color: var(--gray-7);

View File

@ -14,14 +14,19 @@ export default function HomePage() {
heading="Service Networking Across Any Cloud" heading="Service Networking Across Any Cloud"
content="Automate network configurations, discover services, and enable secure connectivity across any cloud or runtime." content="Automate network configurations, discover services, and enable secure connectivity across any cloud or runtime."
links={[ links={[
{
text: 'Get Started',
url: 'https://learn.hashicorp.com/consul',
type: 'outbound',
},
{ {
text: 'Download', text: 'Download',
url: '/downloads', url: '/downloads',
type: 'download', type: 'download',
}, },
{ {
text: 'Get Started', text: 'Try HasiCorp Consul Service on Azure',
url: 'https://learn.hashicorp.com/consul', url: 'https://learn.hashicorp.com/consul/hcs-azure/deploy',
type: 'outbound', type: 'outbound',
}, },
]} ]}