From 1d6e66d93708e5fcab392137a95ca40a31ad6881 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Tue, 11 Dec 2018 15:16:59 +0100 Subject: Change header button color based on theme --- packages/website/ts/@next/components/header.tsx | 17 ++++++++++++++--- packages/website/ts/@next/components/siteWrap.tsx | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/@next/components/header.tsx b/packages/website/ts/@next/components/header.tsx index bce5ccec7..b0dabf98d 100644 --- a/packages/website/ts/@next/components/header.tsx +++ b/packages/website/ts/@next/components/header.tsx @@ -2,7 +2,7 @@ import _ from 'lodash'; import * as React from 'react'; import Headroom from 'react-headroom'; import { Link as ReactRouterLink } from 'react-router-dom'; -import styled from 'styled-components'; +import styled, { withTheme } from 'styled-components'; import { colors } from 'ts/style/colors'; @@ -55,7 +55,7 @@ const navItems: NavItem[] = [ { id: 'blog', url: '#', text: 'Blog' }, ]; -export class Header extends React.Component { +class HeaderBase extends React.Component { public state = { isOpen: false, }; @@ -91,6 +91,7 @@ export class Header extends React.Component { public render(): React.ReactNode { const { isOpen } = this.state; + const { theme } = this.props; return ( @@ -120,7 +121,15 @@ export class Header extends React.Component { {_.map(navItems, (link, index) => this.getNavItem(link, index))} - Trade on 0x + + + Trade on 0x + + @@ -128,6 +137,8 @@ export class Header extends React.Component { } } +export const Header = withTheme(HeaderBase); + const StyledHeader = styled(Section.withComponent('header'))` @media (max-width: ${BREAKPOINTS.mobile}) { min-height: ${props => props.isOpen ? '385px' : '70px'}; diff --git a/packages/website/ts/@next/components/siteWrap.tsx b/packages/website/ts/@next/components/siteWrap.tsx index 395df68a9..5071b8ef4 100644 --- a/packages/website/ts/@next/components/siteWrap.tsx +++ b/packages/website/ts/@next/components/siteWrap.tsx @@ -31,6 +31,7 @@ const GLOBAL_THEMES: ThemeInterface = { dropdownBg: '#111A19', dropdownButtonBg: '#003831', dropdownColor: '#FFFFFF', + headerButtonBg: '#00AE99', }, light: { bgColor: '#FFFFFF', @@ -40,6 +41,7 @@ const GLOBAL_THEMES: ThemeInterface = { dropdownButtonBg: '#F3F6F4', dropdownColor: '#003831', dropdownBorderColor: '#E4E4E4', + headerButtonBg: '#003831', }, gray: { bgColor: '#e0e0e0', @@ -48,6 +50,7 @@ const GLOBAL_THEMES: ThemeInterface = { dropdownBg: '#FFFFFF', dropdownButtonBg: '#F3F6F4', dropdownColor: '#003831', + headerButtonBg: '#003831', }, }; -- cgit v1.2.3