import React, { Fragment } from 'react'
import classNames from 'classnames'
import pattern from '../images/pattern_blue.jpg'
import patternOverlay from '../images/pattern_landing.jpg'
import logoSvgs from '../images/logos'
import Grid from './grid'
import { Content } from './main'
import Button from './button'
import CodeBlock from './code'
import { H1, H2, H3, Label, InlineList } from './typography'
import Link from './link'
import { chunkArray } from './util'
import classes from '../styles/landing.module.sass'
export const LandingHeader = ({ style = {}, children }) => {
const wrapperStyle = { backgroundImage: `url(${pattern})` }
const contentStyle = { backgroundImage: `url(${patternOverlay})`, ...style }
return (
)
}
export const LandingTitle = ({ children }) =>
{children}
export const LandingSubtitle = ({ children }) => (
{children}
)
export const LandingGrid = ({ cols = 3, blocks = false, children }) => (
{children}
)
export const LandingCard = ({ title, children }) => (
{title &&
{title}
}
{children}
)
export const LandingButton = ({ to, children }) => (
)
export const LandingDemo = ({ title, children }) => {
return (
{children}
)
}
export const LandingBannerGrid = ({ children }) => (
{children}
)
export const LandingBanner = ({ title, label, to, button, small, background, color, children }) => {
const contentClassNames = classNames(classes.bannerContent, {
[classes.bannerContentSmall]: small,
})
const textClassNames = classNames(classes.bannerText, {
[classes.bannerTextSmall]: small,
})
const style = { '--color-theme': background, '--color-back': color }
const Heading = small ? H2 : H1
return (
{label && (
{label}
)}
{title}
{children}
{button && (
{button}
)}
)
}
export const LandingBannerButton = ({ to, small, children }) => (
)
export const LandingLogos = ({ logos = [], title, maxRow = 4, children }) => {
const rows = chunkArray(logos, maxRow)
return (
{title && }
{rows.map((logos, i) => (
{logos.map(({ id, url }, j) => {
const Component = logoSvgs[id]
return !Component ? null : (
)
})}
{i === rows.length - 1 && children}
))}
)
}