import React, { Fragment } from 'react'
import classNames from 'classnames'
import pattern from '../images/pattern_blue.jpg'
import patternNightly from '../images/pattern_nightly.jpg'
import patternOverlay from '../images/pattern_landing.jpg'
import patternOverlayNightly from '../images/pattern_landing_nightly.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 = ({ nightly, style = {}, children }) => {
const overlay = nightly ? patternOverlayNightly : patternOverlay
const wrapperStyle = { backgroundImage: `url(${nightly ? patternNightly : pattern})` }
const contentStyle = { backgroundImage: `url(${overlay})`, ...style }
return (
)
}
export const LandingTitle = ({ children }) =>
{children}
export const LandingSubtitle = ({ children }) => (
{children}
)
export const LandingGrid = ({ cols = 3, blocks = false, children }) => (
{children}
)
export const LandingCol = ({ children }) => {children}
export const LandingCard = ({ title, button, url, children }) => (
{title && {title}
}
{children}
{button && url && (
)}
)
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,
backgroundImage,
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,
backgroundImage: backgroundImage ? `url(${backgroundImage})` : null,
}
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}
))}
)
}