added announcement component
This commit is contained in:
parent
82ed9ef25e
commit
13df5adecd
31
packages/website/ts/components/announcement.tsx
Normal file
31
packages/website/ts/components/announcement.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { colors } from '../style/colors';
|
||||
|
||||
import { Link } from './link';
|
||||
import { Paragraph } from './text';
|
||||
|
||||
export interface AnnouncementProps {
|
||||
headline: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const BrandColorSpan = styled.span`
|
||||
color: ${colors.white};
|
||||
padding-right: 12px;
|
||||
`;
|
||||
|
||||
const Wrap = styled.div`
|
||||
padding: 20px 0;
|
||||
color: ${colors.brandLight};
|
||||
`;
|
||||
|
||||
export const Announcement: React.StatelessComponent<AnnouncementProps> = (props: AnnouncementProps) => {
|
||||
return (<Wrap>
|
||||
<Link href={props.href}>
|
||||
<BrandColorSpan>{'New!'}</BrandColorSpan>
|
||||
{props.headline}
|
||||
</Link>
|
||||
</Wrap>);
|
||||
};
|
@ -1,8 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { addFadeInAnimation } from 'ts/constants/animations';
|
||||
|
||||
import { Announcement, AnnouncementProps } from './announcement';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
maxWidth?: string;
|
||||
@ -13,6 +14,7 @@ interface Props {
|
||||
description: string;
|
||||
figure?: React.ReactNode;
|
||||
actions?: React.ReactNode;
|
||||
announcement?: AnnouncementProps;
|
||||
}
|
||||
|
||||
const Section = styled.section`
|
||||
@ -126,6 +128,7 @@ export const Hero: React.StatelessComponent<Props> = (props: Props) => (
|
||||
{props.figure && <Content width="400px">{props.figure}</Content>}
|
||||
|
||||
<Content width={props.maxWidth ? props.maxWidth : props.figure ? '546px' : '678px'}>
|
||||
{!!props.announcement && <Announcement {...props.announcement} />}
|
||||
<Title isLarge={props.isLargeTitle} maxWidth={props.maxWidthHeading}>
|
||||
{props.title}
|
||||
</Title>
|
||||
|
@ -7,6 +7,11 @@ import { LandingAnimation } from 'ts/components/heroImage';
|
||||
import { HeroAnimation } from 'ts/components/heroAnimation';
|
||||
import { WebsitePaths } from 'ts/types';
|
||||
|
||||
const announcement = {
|
||||
headline: 'Vote on ZEIP-23 MultiAssetProxy',
|
||||
href: '/vote',
|
||||
};
|
||||
|
||||
export const SectionLandingHero = () => (
|
||||
<Hero
|
||||
title="Powering Decentralized Exchange"
|
||||
@ -15,6 +20,7 @@ export const SectionLandingHero = () => (
|
||||
description="0x is an open protocol that enables the peer-to-peer exchange of assets on the Ethereum blockchain."
|
||||
figure={<LandingAnimation image={<HeroAnimation />} />}
|
||||
actions={<HeroActions />}
|
||||
announcement={announcement}
|
||||
/>
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user