From 3ac6da7db1570b08636e578bcd96fd470cebf009 Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Mon, 10 Dec 2018 13:37:10 +0100 Subject: Added banner --- packages/website/ts/@next/components/banner.tsx | 75 +++++++++++++++++++++++++ packages/website/ts/@next/components/layout.tsx | 3 + packages/website/ts/@next/pages/why.tsx | 10 +++- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 packages/website/ts/@next/components/banner.tsx (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/components/banner.tsx b/packages/website/ts/@next/components/banner.tsx new file mode 100644 index 000000000..59fbf7fdc --- /dev/null +++ b/packages/website/ts/@next/components/banner.tsx @@ -0,0 +1,75 @@ +import * as React from 'react'; +import styled from 'styled-components'; + +import {colors} from 'ts/style/colors'; + +import {Button, ButtonWrap} from 'ts/@next/components/button'; +import { Column, Section, Wrap, WrapCentered } from 'ts/@next/components/layout'; +import {Paragraph, Heading} from 'ts/@next/components/text'; +import { ThemeInterface } from 'ts/@next/components/siteWrap'; + +interface Props { + heading?: string; + subline?: string; + mainCta?: CTAButton; + secondaryCta?: CTAButton; + theme?: ThemeInterface; +} + +interface CTAButton { + text: string; + href: string; +} + +interface BorderProps { + isBottom?: boolean; +} + +export const Banner: React.StatelessComponent = (props: Props) => { + const { + heading, + subline, + mainCta, + secondaryCta, + } = props; + return ( +
+ + + + + {heading} + {subline && {subline}} + + + + + + {mainCta && } + {secondaryCta && } + + + + + +
+ ); +}; + +const CustomColumn = styled(Column)` + padding: 95px 30px; +`; + +// Note let's refactor this +// is it absolutely necessary to have a stateless component +// to pass props down into the styled icon? +const Border = styled.div` + position: absolute; + background-image: url("data:image/svg+xml;utf8,"); + left: 0; + width: calc(100% + 214px); + height: 40px; + top: ${props => !props.isBottom && 0 }; + bottom: ${props => props.isBottom && 0 }; + transform: ${props => props.isBottom ? 'rotate(180deg) translate(112px)' : 'translate(-112px)' }; +`; diff --git a/packages/website/ts/@next/components/layout.tsx b/packages/website/ts/@next/components/layout.tsx index 48b8ec074..bd3b8a2e3 100644 --- a/packages/website/ts/@next/components/layout.tsx +++ b/packages/website/ts/@next/components/layout.tsx @@ -19,6 +19,7 @@ interface SectionProps { isNoMargin?: boolean; bgColor?: string; isFullWidth?: boolean; + isRelative?: boolean; } interface WrapProps extends PaddingInterface { @@ -85,6 +86,8 @@ export const Section = styled.section` margin-bottom: ${props => !props.isNoMargin && `${GUTTER}px`}; margin-left: ${props => props.isFullWidth && `-${GUTTER}px`}; background-color: ${props => props.bgColor}; + position: ${props => props.isRelative && 'relative'}; + overflow: ${props => props.isRelative && 'hidden'}; @media (min-width: 1560px) { width: ${props => props.isFullWidth && '100vw'}; diff --git a/packages/website/ts/@next/pages/why.tsx b/packages/website/ts/@next/pages/why.tsx index 6b22c6fa4..cf05de6e3 100644 --- a/packages/website/ts/@next/pages/why.tsx +++ b/packages/website/ts/@next/pages/why.tsx @@ -3,6 +3,7 @@ import styled from 'styled-components'; import { colors } from 'ts/style/colors'; +import { Banner } from 'ts/@next/components/banner'; import { Column, Section, Wrap, WrapCentered } from 'ts/@next/components/layout'; import { Link } from 'ts/@next/components/link'; import { SiteWrap } from 'ts/@next/components/siteWrap'; @@ -18,7 +19,7 @@ export const NextWhy = () => ( The exchange layer for the crypto economy - The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastructure that allows anyone in the world to build products that enable the purchasing and trading of crypto tokens. + The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastructure that allows anyone in the world to build products that enable the purchasing and trading of crypto tokens. Build on 0x @@ -95,6 +96,13 @@ export const NextWhy = () => ( + + ); -- cgit