Files
threshold/website/components/downloader/release-information/index.jsx
T
dcb609b831 [Website] Public Launch Assembly (#438)
* Reduce hero size for placeholder

* Clean up Sticky Footer

- Increase the specificity of the selector to prevent any accidental
collisions
- Account for the meganav that exists

* [Website] Add Boundary Features section to homepage (#436)

* Install and implement ProductFeaturesList

* Add images and content

* Inline the product features

* [Website] Add use cases section (#445)

* Commit to illustrate UseCases error

* update react image

* Add in content from design

* Tweaks

* Apply handy edits

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add SectionBreakCta component (#452)

* Create implement barebones component

* Build structure/add content

* Get CSS up to spec

- Typography
- spacing
- Layout
- box-shadow
- Accent line

* Mobile treatment

* Update URL

* Add a break-section to give bg on page

* Change link to outbound

Design is incorrect for this link

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Reduce CSS selectors

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add branded CTA section (#450)

* Create skeleton for component

* Bring in line with CallToAction styles

* Set up background

* Typography and layout (and mobile)

* Button polish

* Changes to prep for updates

These will keep the homepage ready for component updates 
and the upcoming docs and download pages.

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Address feedback

- Reduce button hackiness
- Adjust pattern position on mobile to not overlap button

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Upgrade button, minor tweaks to BrandedCTA (#481)

* Updates dependencies

* [Website] Homepage hero updates (#503)

* Adjustments to align and lay out left side

* Implement hero background

* Adjust hero URLs

* Implement mobile hero pattern/tweaks

* Add video!

* Mobile tweaks

* Remove mobile bg

* Center the text/buttons on mobile

* Remove mobile hero pattern

* Address visual nits

* Adjust interface for video

* [Website] Add "How it works" section (#483)

* Create skeleton and implement component

* Add sections

* Add CSS and adjust structure

* Remove sections ternary

* Change nomenclature for clarity

* Mobile tweaks

* Tweaks inspired by HCP

* Create LogoList component skeleton

* Implement LogoList on main component

- Shift footertext responsibility to it
- Assume logos will be passed in, because it doesn't render otherwise
  anyway with the right checks

* Implement some logos/restructure LogoList

* CSS adjustments to logolist/section layout

* Show example for too many integrations

* Remove cutoff logic

* Add SVGs for diagram stack

* Combine SVGs into a component

This is necessary to act on various parts of the image independently.

* Fully combine SVG and remove unneeded CSS

* Further CSS cleanup

* Implement stickyness

* Set up active example checks for graphic

* Implement reactivity

- Apply styles based on inactivity or activity, whichever fits best
  per-element
- Add expected state to the general HowItWorks component, where it will
  be managed and passed into the diagram
- Make icon and arrow spacers use the same spacer class

* CSS tweaks for design/organization

* Implement scroll-to-animate functionality!

* Fill out icons for integrations

* Feature updates

- Move LogoList into folder
- Give descriptions some margin

* Mobile treatment tweaks

* Import logic from the cloud-platform page on .com

This fixes a bug in which the in-view example would not update in an
expected manner.

* Remove max-width adjustment on UL

* Fix need for height on the graphic

* Padding/margin tweaks

* Minor CSS tweaks

* Final padding adjustments

* Plugging in proper content into the landing page (#545)

* Misc content updates to align with copy doc

* Plug in feature SVGs

* Move use cases up

* Remove the MegaNav - to be replaced soon

* Updates the nav

* Add footer content, security page

* Remove react-mega-nav from styles

* Downloads Page (#541)

* [Website] Add use cases section (#445)

* Commit to illustrate UseCases error

* update react image

* Add in content from design

* Tweaks

* Apply handy edits

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Port new downloader page to Boundary

* update placeholder data

* missing css property

* Fix the weird rebase

* Fix padding

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>
Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add alert banner (#557)

* Bring over waypoint's implementation

* Prove that it works/theme to boundary

* revert to hidden for now

* [Website] README polish (#558)

* Adjust readme for boundary

* Correct URL in first paragraph

* [Website] Add community page (#555)

* Just import files from Consul

* Revert CSS paradigm for VerticalBlockList

* Adds community to the nav

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* A few small content / bug tweaks (#563)

* adds HashiStackMenu

* Fix platform agnostic copy

* Reduce padding between sections

* Fix Subnav indicator for docs page

* Fix features padding

* Adds Favicon

* Update how it works content

* Adds share image

* Updates use cases

* Styling to community page

* Remove some color overrides

* Add SVGO option to nextconfig (#565)

* Add press kit to footer (#567)

* Plug in proper link for onboard users

* Plug in proper video URL (#584)

* Bump HSM version (#582)

* Downloads Page Content (#585)

* Wire up Boundary Downloads content

* Plug in remaining downloads content

* Download via Product slug

* Tweak with transition timing (#587)

* Plug in proper logo into the downloads page (#589)

* Content tweaks (#590)

* Remove border top from footer (#591)

* More content tweaks (#608)

* Updates the hero to support UI/CLI previews (#609)

* Updates the hero to support UI/CLI previews

* Updates video

* More content tweaks (#634)

* Plugs in light theme UI video

* Update infra as code feature

* Remove Auth (#636)

* Remove auth-related files

* Remove auth-related config

* Remove auth provider and next-auth pkgs

* Remove *env.local from gitignore

* Swtich og:image to have a www subdomain

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>

* Elevate prop destructuring to function call

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>

* Update website/pages/community/index.jsx

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>
Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: Jimmy Merritello <7191639+jmfury@users.noreply.github.com>
2020-10-12 15:56:27 -07:00

159 lines
5.2 KiB
React

import { useState, Fragment, useEffect } from 'react'
import Dropdown from 'components/downloader/dropdown'
import {
prettyArch,
prettyOs,
sortPlatforms,
getVersionLabel,
sortAndFilterReleases,
} from 'components/downloader/utils/downloader'
import styles from './style.module.css'
export default function ReleaseInformation({
productId,
productName,
latestVersion,
packageManagers,
containers,
tutorials,
changelog,
brand,
}) {
const [selectedVersionId, setSelectedVersionId] = useState(latestVersion)
const [releases, setReleases] = useState([])
const { version, ...selectedVersion } =
releases.find((release) => release.version === selectedVersionId) || {}
useEffect(() => {
// lazy load all release versions to populate dropdown & releases section
fetch(`https://releases.hashicorp.com/${productId}/index.json`)
.then((res) => res.json())
.then((data) => {
const latestReleases = sortAndFilterReleases(Object.keys(data.versions))
const releases = latestReleases.map((releaseVersion) => ({
...sortPlatforms(data.versions[releaseVersion]),
version: releaseVersion,
}))
setReleases(releases)
})
}, [])
return (
<div className={styles.root}>
<div className="g-container">
<h2>Release Information</h2>
<div className={styles.grid}>
{releases.length > 0 && (
<>
<div className={styles.releases}>Releases:</div>
<div>
<Dropdown
title={`${productName} ${getVersionLabel(
version,
latestVersion
)}`}
brand={brand}
options={releases.map((releaseData) => ({
label: `${productName} ${getVersionLabel(
releaseData.version,
latestVersion
)}`,
value: releaseData.version,
}))}
onChange={(release) => setSelectedVersionId(release)}
/>
<a
href={
changelog ||
`https://github.com/hashicorp/${productId}/blob/v${version}/CHANGELOG.md`
}
className={styles.changelog}
>
Changelog
</a>
</div>
</>
)}
<div className={styles.latestDownloads}>Latest Downloads:</div>
<div>
Package downloads for {productName} {version}
<div className={styles.downloads}>
{Object.entries(selectedVersion).map(([os, release]) => (
<Fragment key={os}>
<div className={styles.os}>{prettyOs(os)}</div>
<div>
{Object.entries(release).map(([arch, file]) => (
<a href={file} key={arch}>
{prettyArch(arch)}
</a>
))}
</div>
</Fragment>
))}
</div>
<p>
You can find the{' '}
<a
href={`https://releases.hashicorp.com/${productId}/${version}/${productId}_${version}_SHA256SUMS`}
>
SHA256 checksums for {productName} {version}
</a>{' '}
online and you can{' '}
<a
href={`https://releases.hashicorp.com/${productId}/${version}/${productId}_${version}_SHA256SUMS.sig`}
>
verify the checksums signature file
</a>{' '}
which has been signed using{' '}
<a href="https://hashicorp.com/security">
HashiCorp&apos;s GPG key.
</a>
</p>
</div>
{packageManagers?.length > 0 && (
<>
<div className={styles.heading}>Package Managers</div>
<div className={styles.links}>
{packageManagers.map((packageManager) => (
<div key={packageManager.label}>
Install with{' '}
<a href={packageManager.url}>{packageManager.label}</a>
</div>
))}
</div>
</>
)}
{containers?.length > 0 && (
<>
<div className={styles.heading}>Containers</div>
<div className={styles.links}>
{containers.map((container) => (
<div key={container.label}>
Run with <a href={container.url}>{container.label}</a>
</div>
))}
</div>
</>
)}
{containers?.length > 0 && (
<>
<div className={styles.heading}>Tutorials</div>
<div className={styles.links}>
{tutorials.map((tutorial) => (
<div key={tutorial.label}>
<a href={tutorial.url}>{tutorial.label}</a>
</div>
))}
</div>
</>
)}
</div>
</div>
</div>
)
}