zepio/app/components/header.js

80 lines
2.1 KiB
JavaScript
Raw Normal View History

2018-12-12 11:05:33 -08:00
// @flow
2019-02-04 20:41:45 -08:00
import React from 'react';
2018-12-12 11:05:33 -08:00
import styled from 'styled-components';
2018-12-15 13:28:36 -08:00
import { ZcashLogo } from './zcash-logo';
2018-12-12 11:05:33 -08:00
import { TextComponent } from './text';
2018-12-20 06:10:03 -08:00
import { Divider } from './divider';
import { RowComponent } from './row';
import { StatusPill } from './status-pill';
import { withSyncStatus } from '../../services/sync-status';
2018-12-12 11:05:33 -08:00
const Wrapper = styled.div`
height: ${props => props.theme.headerHeight};
2018-12-12 11:05:33 -08:00
width: 100vw;
display: flex;
flex-direction: row;
background-color: ${props => props.theme.colors.background};
2018-12-12 11:05:33 -08:00
`;
const LogoWrapper = styled.div`
height: ${props => props.theme.headerHeight};
width: ${props => props.theme.sidebarWidth};
2018-12-12 11:05:33 -08:00
background-image: linear-gradient(
to right,
${props => props.theme.colors.sidebarLogoGradientBegin},
${props => props.theme.colors.sidebarLogoGradientEnd}
2018-12-12 11:05:33 -08:00
);
margin-bottom: 20px;
`;
const TitleWrapper = styled.div`
width: ${props => `calc(100% - ${props.theme.sidebarWidth})`};
height: ${props => props.theme.headerHeight};
2018-12-12 11:05:33 -08:00
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
padding-top: 10px;
padding-left: ${props => props.theme.layoutPaddingLeft};
padding-right: ${props => props.theme.layoutPaddingRight};
2018-12-12 11:05:33 -08:00
`;
const TitleRow = styled(RowComponent)`
align-items: center;
justify-content: space-between;
width: 100%;
`;
2018-12-12 11:05:33 -08:00
const Title = styled(TextComponent)`
font-size: ${props => `${props.theme.fontSize.large}em`};
2018-12-12 11:05:33 -08:00
margin-top: 10px;
margin-bottom: 10px;
2018-12-12 11:54:34 -08:00
text-transform: capitalize;
letter-spacing: 0.25px;
font-weight: ${props => String(props.theme.fontWeight.bold)};
2018-12-12 11:05:33 -08:00
`;
type Props = {
title: string,
};
const Status = withSyncStatus(StatusPill);
export const HeaderComponent = ({ title }: Props) => (
<Wrapper id='header'>
<LogoWrapper>
<ZcashLogo />
</LogoWrapper>
<TitleWrapper>
<TitleRow alignItems='center' justifyContent='space-around'>
<Title value={title} />
<Status type='syncing' progress={0} />
</TitleRow>
<Divider opacity={0.1} />
</TitleWrapper>
</Wrapper>
);