1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

working on making header more consistant with design

This commit is contained in:
Alex Windett 2017-02-06 12:05:58 +00:00
parent 8783e1a1bb
commit 087d420f85
6 changed files with 72 additions and 58 deletions

View File

@ -1,40 +1,44 @@
const Container = require('@ui/components/container'); const Container = require('@ui/components/container');
const Row = require('@ui/components/row'); const Row = require('@ui/components/row');
const Column = require('@ui/components/column'); const Column = require('@ui/components/column');
const BaseElements = require('@ui/components/base-elements');
const PropTypes = require('@root/prop-types'); const PropTypes = require('@root/prop-types');
const React = require('react'); const React = require('react');
const ReactRouter = require('react-router'); const ReactRouter = require('react-router');
const Styled = require('styled-components'); const Styled = require('styled-components');
const flatten = require('lodash.flatten'); const flatten = require('lodash.flatten');
const fns = require('@ui/shared/functions'); const fns = require('@ui/shared/functions');
const constants = require('@ui/shared/constants');
const { const {
remcalc remcalc
} = fns; } = fns;
const {
colors,
} = constants;
const {
H1,
} = BaseElements;
const { const {
default: styled default: styled
} = Styled; } = Styled;
// Main Contonent Wrapper Styles // Main Contonent Wrapper Styles
const StyledDiv = styled.div` const StyledDiv = styled.div`
background-color: #FAFAFA;
height: ${remcalc(91)};
border-bottom: solid ${remcalc(1)} #d8d8d8; border-bottom: solid ${remcalc(1)} #d8d8d8;
padding: ${remcalc(30)} 0;
margin-bottom: ${remcalc(21)};
`; `;
const BreadcrumbA = styled.a` const BreadcrumbA = styled.a`
text-decoration: none !important; text-decoration: none;
`; `;
const BreadcrumbSpan = styled.span` const BreadcrumbSpan = styled.span`
color: #646464; color: ${colors.base.secondaryDark};
`;
const H1 = styled.h1`
margin: 0 0 0 0;
padding-top: ${remcalc(31)};
padding-bottom: ${remcalc(31)};
`; `;
const { const {
@ -83,11 +87,7 @@ const Breadcrumb = ({
<Row> <Row>
<Column xs={12}> <Column xs={12}>
<StyledDiv> <StyledDiv>
<H1 <H1>
style={{
fontSize: remcalc(24)
}}
>
{getNameLink(name)} {getNameLink(name)}
</H1> </H1>
</StyledDiv> </StyledDiv>

View File

@ -3,7 +3,6 @@ const ReactRouter = require('react-router');
const Styled = require('styled-components'); const Styled = require('styled-components');
const Column = require('@ui/components/column'); const Column = require('@ui/components/column');
const Container = require('@ui/components/container');
const Avatar = require('@ui/components/avatar'); const Avatar = require('@ui/components/avatar');
const fns = require('@ui/shared/functions'); const fns = require('@ui/shared/functions');
const logo = require('@resources/logo.svg'); const logo = require('@resources/logo.svg');
@ -11,6 +10,7 @@ const PropTypes = require('@root/prop-types');
const Row = require('@ui/components/row'); const Row = require('@ui/components/row');
const Tooltip = require('@ui/components/tooltip'); const Tooltip = require('@ui/components/tooltip');
const composers = require('@ui/shared/composers'); const composers = require('@ui/shared/composers');
const constants = require('@ui/shared/constants');
const { const {
Link Link
@ -28,26 +28,32 @@ const {
pseudoEl pseudoEl
} = composers; } = composers;
const {
colors,
} = constants;
const borderSide = props => props.toggled const borderSide = props => props.toggled
? 'bottom' ? 'bottom'
: 'top'; : 'top';
const StyledHeader = styled.header` const StyledHeader = styled.header`
background-color: #ffffff; background-color: ${colors.base.white};
padding-top: ${remcalc(21)}; padding: 0 ${remcalc(18)};
padding-bottom: ${remcalc(21)};
`; `;
const StyledLogo = styled.img` const StyledLogo = styled.img`
padding-top: ${remcalc(10)}; padding-top: ${remcalc(12)};
`; `;
const StyledProfileWrapper = styled.div` const StyledProfileWrapper = styled.div`
position: relative; position: relative;
padding-top: ${remcalc(6)};
text-align: right; text-align: right;
`; `;
const StyledAvatarWrapper = styled.div` const StyledAvatarWrapper = styled.div`
display: inline-block;
&:after { &:after {
border-left: ${remcalc(5)} solid transparent; border-left: ${remcalc(5)} solid transparent;
border-right: ${remcalc(5)} solid transparent; border-right: ${remcalc(5)} solid transparent;
@ -55,7 +61,7 @@ const StyledAvatarWrapper = styled.div`
${pseudoEl({ ${pseudoEl({
top: '50%', top: '50%',
right: remcalc(10) right: remcalc(-10),
})} })}
} }
`; `;
@ -67,8 +73,9 @@ const StyledTooltipWrapper = styled.div`
`; `;
const StyledName = styled.span` const StyledName = styled.span`
color: #646464; color: ${colors.base.secondaryDark};
font-size: ${remcalc(16)} font-size: ${remcalc(16)};
height: ${remcalc(66)};
position: relative; position: relative;
top: ${remcalc(-12)}; top: ${remcalc(-12)};
`; `;
@ -115,32 +122,30 @@ const Header = ({
return ( return (
<StyledHeader name="application-header"> <StyledHeader name="application-header">
<Container fluid> <Row>
<Row> <Column lg={10} xs={8}>
<Column lg={10} xs={8}> <Link to='/'>
<Link to='/'> <StyledLogo alt='Joyent' src={logo} />
<StyledLogo alt='Joyent' src={logo} /> </Link>
</Link> </Column>
</Column> <Column lg={2} xs={4}>
<Column lg={2} xs={4}> <StyledProfileWrapper>
<StyledProfileWrapper> <StyledAvatarWrapper toggled={tooltip}>
<StyledAvatarWrapper toggled={tooltip}> <EmptyButton onClick={handleToggleClick}>
<EmptyButton onClick={handleToggleClick}> <StyledName>
<StyledName> {account.name}
{account.name} </StyledName>
</StyledName> <StyledAvatar
<StyledAvatar alt={account.name}
alt={account.name} name={account.name}
name={account.name} src={account.avatar}
src={account.avatar} />
/> </EmptyButton>
</EmptyButton> </StyledAvatarWrapper>
</StyledAvatarWrapper> {tooltipComponent}
{tooltipComponent} </StyledProfileWrapper>
</StyledProfileWrapper> </Column>
</Column> </Row>
</Row>
</Container>
</StyledHeader> </StyledHeader>
); );
}; };

View File

@ -89,6 +89,10 @@ const Shadow = styled.div`
linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.06)); linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.06));
`; `;
const StyledUL = styled(Ul)`
padding: 0;
`;
const OrgNavigation = ({ const OrgNavigation = ({
orgs = [] orgs = []
}) => { }) => {
@ -133,9 +137,9 @@ const OrgNavigation = ({
return ( return (
<StyledNav> <StyledNav>
<Container> <Container>
<Ul> <StyledUL>
{navLinks} {navLinks}
</Ul> </StyledUL>
</Container> </Container>
</StyledNav> </StyledNav>
); );

View File

@ -26,9 +26,7 @@ const {
} = constants; } = constants;
const StyledHorizontalList = styled(Ul)` const StyledHorizontalList = styled(Ul)`
${breakpoints.smallOnly` padding: 0;
padding: 0
`}
`; `;
const StyledHorizontalListItem = styled(Li)` const StyledHorizontalListItem = styled(Li)`

View File

@ -4,11 +4,16 @@ const Styled = require('styled-components');
const React = require('react'); const React = require('react');
const fns = require('../../shared/functions'); const fns = require('../../shared/functions');
const constants = require('../../shared/constants');
const { const {
default: styled default: styled
} = Styled; } = Styled;
const {
colors,
} = constants;
const { const {
remcalc remcalc
} = fns; } = fns;
@ -23,8 +28,8 @@ const elements = [
'font-weight': 600, 'font-weight': 600,
'font-style': 'normal', 'font-style': 'normal',
'font-stretch': 'normal', 'font-stretch': 'normal',
'color': '#364acd', 'color': colors.base.primaryLight,
'border-bottom': `${remcalc(1)} solid #d8d8d8`, 'margin' : 0
} }
}, },
{ {

View File

@ -16,9 +16,11 @@ const {
module.exports = styled.li` module.exports = styled.li`
display: inline-block; display: inline-block;
margin-right: ${remcalc(24)};
padding-top: ${remcalc(10)};
padding-bottom: ${remcalc(10)}; padding-bottom: ${remcalc(10)};
& + & {
margin-left: ${remcalc(24)};
}
& a { & a {
color: ${colors.base.primary}; color: ${colors.base.primary};