feat(joyent-cp-frontend): integrate toolkit's Header
This commit is contained in:
parent
56315d02c7
commit
f17fae6a74
@ -8,45 +8,28 @@ import unitcalc from 'unitcalc';
|
|||||||
|
|
||||||
import Logo from '@assets/triton_logo.png';
|
import Logo from '@assets/triton_logo.png';
|
||||||
import { Col, Row } from 'react-styled-flexboxgrid';
|
import { Col, Row } from 'react-styled-flexboxgrid';
|
||||||
import { P } from 'joyent-ui-toolkit';
|
import { P, Header, HeaderBrand, HeaderItem } from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
const StyledHeader = styled.div`
|
|
||||||
background-color: ${props => props.theme.primaryDarkBrand};
|
|
||||||
padding: ${unitcalc(2.5)} ${unitcalc(3)} ${unitcalc(2)} ${unitcalc(3)};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledLogo = Img.extend`
|
const StyledLogo = Img.extend`
|
||||||
width: ${remcalc(87)};
|
width: ${remcalc(87)};
|
||||||
height: ${remcalc(25)};
|
height: ${remcalc(25)};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledP = styled(P)`
|
const NavHeader = ({ datacenter, username }) => (
|
||||||
color: ${props => props.theme.white};
|
<Header>
|
||||||
font-weight: 600;
|
<HeaderBrand>
|
||||||
margin: ${unitcalc(0.5)} 0 0 0;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Header = ({ datacenter, username }) => (
|
|
||||||
<StyledHeader>
|
|
||||||
<Row>
|
|
||||||
<Col xs={6} sm={8} md={10}>
|
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<StyledLogo src={Logo} />
|
<StyledLogo src={Logo} />
|
||||||
</Link>
|
</Link>
|
||||||
</Col>
|
</HeaderBrand>
|
||||||
<Col xs={3} sm={2} md={1}>
|
<HeaderItem>{datacenter}</HeaderItem>
|
||||||
<StyledP>{datacenter}</StyledP>
|
<HeaderItem>{username}</HeaderItem>
|
||||||
</Col>
|
</Header>
|
||||||
<Col xs={3} sm={2} md={1}>
|
|
||||||
<StyledP>{username}</StyledP>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</StyledHeader>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Header.propTypes = {
|
NavHeader.propTypes = {
|
||||||
datacenter: PropTypes.string,
|
datacenter: PropTypes.string,
|
||||||
username: PropTypes.string
|
username: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Header;
|
export default NavHeader;
|
||||||
|
Loading…
Reference in New Issue
Block a user