This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/app/components/Sidebar/components/HeaderBlock.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-09-04 00:27:12 +00:00
// @flow
2018-05-05 23:16:08 +00:00
import * as React from 'react';
2017-09-04 00:27:12 +00:00
import styled from 'styled-components';
2017-10-27 05:42:08 +00:00
import { color } from 'shared/styles/constants';
import Flex from 'shared/components/Flex';
import TeamLogo from './TeamLogo';
2017-09-04 00:27:12 +00:00
type Props = {
teamName: string,
subheading: string,
logoUrl: string,
2017-09-04 00:27:12 +00:00
};
function HeaderBlock({ teamName, subheading, logoUrl, ...rest }: Props) {
2017-09-04 00:27:12 +00:00
return (
<Header justify="flex-start" align="center" {...rest}>
<TeamLogo src={logoUrl} />
2017-09-04 19:26:00 +00:00
<Flex align="flex-start" column>
<TeamName>{teamName}</TeamName>
<Subheading>{subheading}</Subheading>
2017-09-04 00:27:12 +00:00
</Flex>
</Header>
);
}
const Subheading = styled.div`
padding-left: 10px;
font-size: 11px;
text-transform: uppercase;
font-weight: 500;
color: ${color.slateDark};
2017-09-04 06:03:49 +00:00
`;
2017-09-04 15:32:31 +00:00
const TeamName = styled.div`
padding-left: 10px;
font-weight: 600;
2017-09-04 00:27:12 +00:00
color: ${color.text};
text-decoration: none;
font-size: 16px;
`;
const Header = styled(Flex)`
flex-shrink: 0;
2017-09-25 03:03:03 +00:00
padding: 16px 24px;
2017-09-04 06:03:49 +00:00
position: relative;
cursor: pointer;
width: 100%;
2017-09-04 15:32:31 +00:00
&:active,
2017-09-04 06:03:49 +00:00
&:hover {
transition: background 100ms ease-in-out;
2017-11-10 22:14:30 +00:00
background: rgba(0, 0, 0, 0.05);
2017-09-04 06:03:49 +00:00
}
2017-09-04 00:27:12 +00:00
`;
export default HeaderBlock;