open-vault/website/components/before-after-diagram/index.jsx

88 lines
2.4 KiB
React
Raw Normal View History

import Image from '@hashicorp/react-image'
import InlineSvg from '@hashicorp/react-inline-svg'
[Assembly]: Branding Refresh (#11118) * style: update gray brand colors (#11092) * Style: Update brand colors (#11224) * style: update brand colors * chore: upgrade react-components * style: update use cases page btn --> vault brand * chore: home page component api updates * style: fix link colors * run npm audit * upgrade downloads page * typo fixes * fix husky, run lint * roll back husky upgrade * style(home callouts): body copy gray -2 * style: testing hashi-stack-menu prerelease * style: upgrade components --> color contrast (#11328) * chore: upgrades components w/ new styles * refactor(use-cases pages): to use FeaturedSlider component * style(BeforeAfterDiagram): swap check icon * style(use-cases-cta): adjust background color --> vault primary * chore(community): pass to VerticalBlockTextList * chore(deps): adds tippy.js * chore(deps): upgrade product downloads pre-release * fix(subnav): use asPath to set active item * chore: upgrade deps to stable * style: home callouts body copy to black * chore: upgrade hashi-stack-menu to stable * chore: upgrade deps * style(use-cases): update background and button colors * chore: upgrade deps body copy color * chore: upgrades alert-banner * fix: remove package.json * content(home): removes hero background image * content(home): updates assets * content(use-cases): updates assets * style(before-after-diagram): adjust scaling styles * content:swap svgs for pngs * style: updates before/after diagram * chore: testing product download page pre-release * content: updates consul & nomad logomarks * chore: updates product download page to stable Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
2021-05-03 22:01:29 +00:00
import alertIcon from 'public/img/icons/alert.svg?include'
import checkIcon from 'public/img/icons/check.svg?include'
import fragment from './fragment.graphql'
import s from './style.module.css'
function BeforeAfterDiagram(props) {
const {
theme,
beforeHeadline,
beforeContent,
beforeImage,
afterHeadline,
afterContent,
afterImage,
} = props
return (
<div className={s.beforeAfterDiagram} data-theme={theme}>
<div className={s.beforeSide}>
<div className={s.image}>
<div>
<Image {...beforeImage} />
</div>
</div>
<div className={s.contentContainer}>
<span className={s.iconLineContainer}>
<InlineSvg className={s.beforeIcon} src={alertIcon} />
[Assembly]: Branding Refresh (#11118) * style: update gray brand colors (#11092) * Style: Update brand colors (#11224) * style: update brand colors * chore: upgrade react-components * style: update use cases page btn --> vault brand * chore: home page component api updates * style: fix link colors * run npm audit * upgrade downloads page * typo fixes * fix husky, run lint * roll back husky upgrade * style(home callouts): body copy gray -2 * style: testing hashi-stack-menu prerelease * style: upgrade components --> color contrast (#11328) * chore: upgrades components w/ new styles * refactor(use-cases pages): to use FeaturedSlider component * style(BeforeAfterDiagram): swap check icon * style(use-cases-cta): adjust background color --> vault primary * chore(community): pass to VerticalBlockTextList * chore(deps): adds tippy.js * chore(deps): upgrade product downloads pre-release * fix(subnav): use asPath to set active item * chore: upgrade deps to stable * style: home callouts body copy to black * chore: upgrade hashi-stack-menu to stable * chore: upgrade deps * style(use-cases): update background and button colors * chore: upgrade deps body copy color * chore: upgrades alert-banner * fix: remove package.json * content(home): removes hero background image * content(home): updates assets * content(use-cases): updates assets * style(before-after-diagram): adjust scaling styles * content:swap svgs for pngs * style: updates before/after diagram * chore: testing product download page pre-release * content: updates consul & nomad logomarks * chore: updates product download page to stable Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
2021-05-03 22:01:29 +00:00
<span className={s.lineSegment} />
</span>
<div>
{beforeHeadline && (
<h2
className={s.contentHeadline}
dangerouslySetInnerHTML={{
__html: beforeHeadline,
}}
/>
)}
{beforeContent && (
<div
className={s.beforeContent}
dangerouslySetInnerHTML={{
__html: beforeContent,
}}
/>
)}
</div>
</div>
</div>
<div className={s.afterSide}>
<div className={s.image}>
<div>
<Image {...afterImage} />
</div>
</div>
<div className={s.contentContainer}>
<span className={s.iconLineContainer}>
<InlineSvg className={s.afterIcon} src={checkIcon} />
</span>
<div>
{afterHeadline && (
<h2
className={s.contentHeadline}
dangerouslySetInnerHTML={{
__html: afterHeadline,
}}
/>
)}
{afterContent && (
<div
className={s.afterContent}
data-theme={theme}
dangerouslySetInnerHTML={{
__html: afterContent,
}}
/>
)}
</div>
</div>
</div>
</div>
)
}
BeforeAfterDiagram.fragmentSpec = { fragment, dependencies: [Image] }
export default BeforeAfterDiagram