Added new tab prop to announcement

This commit is contained in:
Chris Kalani 2019-06-03 11:55:19 -07:00
parent e737395c2b
commit da9e90faf0
2 changed files with 8 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import { Button } from './button';
export interface AnnouncementProps { export interface AnnouncementProps {
headline: string; headline: string;
href: string; href: string;
shouldOpenInNewTab?: boolean;
} }
const BrandColorSpan = styled.span` const BrandColorSpan = styled.span`
@ -31,7 +32,12 @@ const AnnouncementLink = styled(Button)`
export const Announcement: React.StatelessComponent<AnnouncementProps> = (props: AnnouncementProps) => { export const Announcement: React.StatelessComponent<AnnouncementProps> = (props: AnnouncementProps) => {
return ( return (
<Wrap> <Wrap>
<AnnouncementLink isWithArrow={true} isAccentColor={true} href={props.href}> <AnnouncementLink
isWithArrow={true}
isAccentColor={true}
href={props.href}
target={props.shouldOpenInNewTab ? '_blank' : ''}
>
<BrandColorSpan>{'New!'}</BrandColorSpan> <BrandColorSpan>{'New!'}</BrandColorSpan>
{props.headline} {props.headline}
</AnnouncementLink> </AnnouncementLink>

View File

@ -10,6 +10,7 @@ import { WebsitePaths } from 'ts/types';
const announcement = { const announcement = {
headline: 'StarkDEX: Bringing STARKs to Ethereum', headline: 'StarkDEX: Bringing STARKs to Ethereum',
href: 'https://www.starkdex.io', href: 'https://www.starkdex.io',
shouldOpenInNewTab: true,
}; };
export const SectionLandingHero = () => ( export const SectionLandingHero = () => (