From 3d09a4e019b16a52694efedd1c2da3399e0df3ca Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Thu, 25 Apr 2019 13:08:13 +0200 Subject: [PATCH] use Header from tuc --- src/components/Header/index.js | 252 ++++----------------------------- 1 file changed, 31 insertions(+), 221 deletions(-) diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 24a7fc8b..668f7d08 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -1,10 +1,7 @@ /* eslint-disable jsx-a11y/accessible-emoji */ /* @flow */ -import React from 'react'; -import styled from 'styled-components'; -import { NavLink } from 'react-router-dom'; -import { SCREEN_SIZE } from 'config/variables'; -import { Icon, icons, colors } from 'trezor-ui-components'; +import * as React from 'react'; +import { Header } from 'trezor-ui-components'; import { FormattedMessage } from 'react-intl'; import type { toggleSidebar as toggleSidebarType } from 'actions/WalletActions'; @@ -12,226 +9,39 @@ import l10nMessages from './index.messages'; import LanguagePicker from './components/LanguagePicker/Container'; -const Wrapper = styled.header` - width: 100%; - height: 52px; - background: ${colors.HEADER}; - z-index: 200; -`; - -const LayoutWrapper = styled.div` - width: 100%; - height: 100%; - max-width: 1170px; - margin: 0 auto; - display: flex; - align-items: center; - justify-content: space-between; - - @media screen and (max-width: 1170px) { - padding: 0 25px; - } -`; - -const Left = styled.div` - display: none; - flex: 0 0 33%; - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - display: initial; - } -`; - -const MenuToggler = styled.div` - display: none; - white-space: nowrap; - color: ${colors.WHITE}; - align-self: center; - align-items: center; - cursor: pointer; - user-select: none; - padding: 10px 0px; - transition: all 0.1s ease-in; - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - display: flex; - } -`; - -const TogglerText = styled.div` - margin-left: 6px; -`; - -const TREZOR = styled.div``; -const T = styled.div``; - -const Logo = styled.div` - flex: 1; - justify-content: flex-start; - display: flex; - - ${T} { - display: none; - width: 20px; - } - - ${TREZOR} { - width: 100px; - } - - svg { - fill: ${colors.WHITE}; - height: 28px; - } - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - flex: 1 0 33%; - justify-content: center; - } - - @media screen and (max-width: ${SCREEN_SIZE.XS}) { - /* hides full width trezor logo, shows only trezor icon */ - ${TREZOR} { - display: none; - } - - ${T} { - display: inherit; - } - } -`; - -const MenuLinks = styled.div` - display: flex; - align-content: center; - justify-content: flex-end; - flex: 0; - height: 100%; - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - flex: 0 1 33%; - } -`; - -const Projects = styled.div` - display: flex; - align-items: center; - height: 100%; - border-right: 1px solid ${colors.HEADER_DIVIDER}; - padding-right: 24px; - margin-right: 24px; - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - display: none; - } -`; - -const A = styled.a` - color: ${colors.WHITE}; - margin-left: 24px; - transition: all 0.1s ease-in; - white-space: nowrap; - - &:visited { - color: ${colors.WHITE}; - margin-left: 24px; - } - - &:first-child { - margin: 0px; - } - - &:hover, - &:active { - color: ${colors.TEXT_SECONDARY}; - } -`; - -type Props = { +type MyProps = { sidebarEnabled?: boolean, sidebarOpened?: ?boolean, toggleSidebar?: toggleSidebarType, }; -const Header = ({ sidebarEnabled, sidebarOpened, toggleSidebar }: Props) => ( - - - - {sidebarEnabled && ( - - {sidebarOpened ? ( - <> - - - - - - ) : ( - <> - - - - - - )} - - )} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const MyHeader = ({ sidebarEnabled, sidebarOpened, toggleSidebar }: MyProps) => ( +
} + togglerCloseText={} + links={[ + { + href: 'https://trezor.io/', + title: , + }, + { + href: 'https://wiki.trezor.io/', + title: , + }, + { + href: 'https://blog.trezor.io/', + title: , + }, + { + href: 'https://trezor.io/support/', + title: , + }, + ]} + rightAddon={} + /> ); -export default Header; +export default MyHeader;