1
0
mirror of synced 2025-12-22 03:16:52 -05:00
Files
docs/components/landing/LandingSection.tsx
Mike Surowiec 5396f5f9e4 React: All landing pages (#19943)
* default all remaining landing pages to react, update tests
2021-06-17 10:04:53 -07:00

34 lines
900 B
TypeScript

import cx from 'classnames'
type Props = {
title?: React.ReactNode
sectionLink?: string
children?: React.ReactNode
className?: string
description?: string
}
export const LandingSection = ({ title, children, className, sectionLink, description }: Props) => {
return (
<div className={cx('container-xl px-3 px-md-6', className)} id={sectionLink}>
{title && (
<h2 className={cx('font-mktg h1 color-text-primary', !description ? 'mb-3' : 'mb-4')}>
{sectionLink ? (
<a className="color-unset" href={`#${sectionLink}`}>
{title}
</a>
) : (
title
)}
</h2>
)}
{description && (
<div
className="lead-mktg color-text-secondary f4 description-text"
dangerouslySetInnerHTML={{ __html: description }}
/>
)}
{children}
</div>
)
}