Skip to content

Commit

Permalink
feat: remove formLeadInput support (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstaley committed May 2, 2023
1 parent 9d34c38 commit e99310f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 159 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-eagles-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hashicorp/react-hero': major
---

Remove support for formLeadInput
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions packages/hero/fragment.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ fragment heroFields on HeroSectionRecord {
external
url
}
formLeadInput {
destinationUrl
buttonText
}
helpText(markdown: true)
smallTextTag
theme
Expand Down
116 changes: 0 additions & 116 deletions packages/hero/heroLeadForm.js

This file was deleted.

16 changes: 1 addition & 15 deletions packages/hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { eliminateOrphans } from '@hashicorp/js-utils'
import useProductMeta from '@hashicorp/platform-product-meta'
import VideoCarousel from './carousel'
import ArrowIcon from './arrow-icon'
import HeroLeadForm from './heroLeadForm'
import fragment from './fragment.graphql'
import s from './style.module.css'

Expand All @@ -25,7 +24,6 @@ function Hero({ data, centered, gaPrefix, className, videoControlsTop }) {
backgroundTheme = 'dark',
buttons,
description,
formLeadInput,
helpText,
image,
product,
Expand Down Expand Up @@ -97,19 +95,7 @@ function Hero({ data, centered, gaPrefix, className, videoControlsTop }) {
}}
/>
)}
{formLeadInput ? (
<div className={s.headlineFormLead}>
<HeroLeadForm
submitRedirectUrl={formLeadInput.destinationUrl}
buttonText={formLeadInput.buttonText}
theme={{
background: backgroundTheme,
brand: product,
variant: 'primary',
}}
/>
</div>
) : buttons && buttons.length ? (
{buttons && buttons.length ? (
<div
className={classNames(s.headlineButtons, {
[s.centered]: isCentered,
Expand Down
2 changes: 0 additions & 2 deletions packages/hero/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ test.todo('renders the `backgroundImage` prop correctly')
test.todo('renders the `smallTextTag` prop correctly')
test.todo('renders the `titleLogo` prop correctly')
test.todo('renders the `alert` prop correctly')
test.todo('renders the `formLeadInput` prop correctly')
test.todo('submits form data correctly from `formLeadInput`')
test.todo('renders the `buttons` prop correctly')
test.todo('renders the `helpText` prop correctly as text, html, or markdown')
test.todo('renders the `videos` prop correctly')
Expand Down
2 changes: 0 additions & 2 deletions packages/hero/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
"@hashicorp/react-alert": "^6.0.2",
"@hashicorp/react-button": "^6.0.4",
"@hashicorp/react-image": "^4.0.4",
"@hashicorp/react-text-input": "^5.0.1",
"classnames": "^2.3.1",
"formik": "^2.2.9",
"promise-polyfill": "^8.2.1",
"query-string": "^6.14.1"
},
Expand Down
22 changes: 4 additions & 18 deletions packages/hero/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ module.exports = {
text: { type: 'string' },
},
},
formLeadInput: {
type: 'object',
description:
'A single-field form intended to capture emails, appears below the headline, description, and buttons',
properties: {
destinationUrl: { type: 'string' },
buttonText: { type: 'string' },
},
},
buttons: {
type: 'array',
description:
Expand Down Expand Up @@ -158,15 +149,13 @@ module.exports = {
backgroundTheme: 'dark',
theme: 'nomad-green',
backgroundImage: {
url:
'https://www.datocms-assets.com/2885/1538522323-vault-grid-background.jpg',
url: 'https://www.datocms-assets.com/2885/1538522323-vault-grid-background.jpg',
format: 'svg',
alt: 'terraform background',
},
smallTextTag: null,
titleLogo: {
url:
'https://www.datocms-assets.com/2885/1512161155-terraform-color.svg',
url: 'https://www.datocms-assets.com/2885/1512161155-terraform-color.svg',
format: 'svg',
alt: 'terraform logo',
},
Expand All @@ -176,7 +165,6 @@ module.exports = {
tagColor: 'error-red',
text: 'Some notification',
},
formLeadInput: { destinationUrl: '#', buttonText: 'Submit' },
buttons: [
{
title: 'Download',
Expand Down Expand Up @@ -208,8 +196,7 @@ module.exports = {
},
{
srcType: 'mp4',
url:
'//consul-static-asssets.global.ssl.fastly.net/videos/v1/connect-video-ui.mp4',
url: '//consul-static-asssets.global.ssl.fastly.net/videos/v1/connect-video-ui.mp4',
},
],
},
Expand All @@ -218,8 +205,7 @@ module.exports = {
src: [
{
srcType: 'mp4',
url:
'//consul-static-asssets.global.ssl.fastly.net/videos/v1/connect-video-cli.mp4',
url: '//consul-static-asssets.global.ssl.fastly.net/videos/v1/connect-video-cli.mp4',
},
],
},
Expand Down

1 comment on commit e99310f

@vercel
Copy link

@vercel vercel bot commented on e99310f May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.