2017-02-27 17:41:08 +02:00
|
|
|
import { Subscriber } from 'react-broadcast';
|
2017-02-20 18:15:36 +02:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import { Baseline } from '../../shared/composers';
|
|
|
|
import { colors } from '../../shared/constants';
|
|
|
|
import { remcalc, is } from '../../shared/functions';
|
|
|
|
import Button from '../button';
|
|
|
|
import React from 'react';
|
2017-01-09 14:13:12 +02:00
|
|
|
|
|
|
|
const Nav = styled.nav`
|
|
|
|
flex: 0 0 ${remcalc(47)};
|
2017-02-20 18:15:36 +02:00
|
|
|
border-left: ${remcalc(1)} solid ${colors.base.grey};
|
2017-02-27 17:41:08 +02:00
|
|
|
box-sizing: border-box;
|
2017-02-20 18:15:36 +02:00
|
|
|
|
|
|
|
${is('fromHeader')`
|
2017-03-20 17:58:47 +02:00
|
|
|
border-left-color: ${colors.base.primaryDesaturatedActive};
|
2017-02-20 18:15:36 +02:00
|
|
|
`};
|
2017-01-09 14:13:12 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledButton = styled(Button)`
|
2017-03-20 17:58:47 +02:00
|
|
|
position: relative;
|
2017-01-09 14:13:12 +02:00
|
|
|
border-width: 0;
|
|
|
|
box-shadow: none;
|
|
|
|
width: 100%;
|
2017-02-27 17:41:08 +02:00
|
|
|
min-width: auto;
|
2017-02-20 18:15:36 +02:00
|
|
|
height: ${remcalc(124)};
|
|
|
|
|
2017-02-27 17:41:08 +02:00
|
|
|
display: flex;
|
|
|
|
overflow-x: visible;
|
|
|
|
overflow-y: visible;
|
|
|
|
|
2017-02-20 18:15:36 +02:00
|
|
|
${is('collapsed')`
|
|
|
|
height: ${remcalc(46)};
|
|
|
|
`};
|
2017-01-09 14:13:12 +02:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
border-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active,
|
|
|
|
&:active:hover,
|
|
|
|
&:active:focus {
|
|
|
|
border-width: 0;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2017-03-20 17:58:47 +02:00
|
|
|
const StyledContainer = styled.div`
|
|
|
|
position: absolute;
|
|
|
|
left: 50%;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledCircle = styled.div`
|
|
|
|
margin: 0 0 2px -2px;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: ${colors.base.white};
|
|
|
|
width: 4px;
|
|
|
|
height: 4px;
|
|
|
|
`;
|
|
|
|
|
2017-02-27 17:41:08 +02:00
|
|
|
const Options = ({
|
2017-02-20 18:15:36 +02:00
|
|
|
...props
|
2017-02-27 17:41:08 +02:00
|
|
|
}) => {
|
|
|
|
const render = ({
|
|
|
|
fromHeader = false,
|
|
|
|
collapsed = false
|
|
|
|
}) => (
|
|
|
|
<Nav fromHeader={fromHeader} name='list-item-options'>
|
|
|
|
<StyledButton
|
|
|
|
secondary={!fromHeader}
|
|
|
|
collapsed={collapsed}
|
|
|
|
rect
|
|
|
|
{...props}
|
|
|
|
>
|
2017-03-20 17:58:47 +02:00
|
|
|
<StyledContainer>
|
|
|
|
<StyledCircle />
|
|
|
|
<StyledCircle />
|
|
|
|
<StyledCircle />
|
|
|
|
</StyledContainer>
|
2017-02-27 17:41:08 +02:00
|
|
|
</StyledButton>
|
|
|
|
</Nav>
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Subscriber channel='list-item'>
|
|
|
|
{render}
|
|
|
|
</Subscriber>
|
|
|
|
);
|
|
|
|
};
|
2017-01-09 14:13:12 +02:00
|
|
|
|
|
|
|
Options.propTypes = {
|
2017-02-27 17:41:08 +02:00
|
|
|
collapsed: React.PropTypes.bool,
|
|
|
|
fromHeader: React.PropTypes.bool
|
2017-01-09 14:13:12 +02:00
|
|
|
};
|
|
|
|
|
2017-02-20 18:15:36 +02:00
|
|
|
export default Baseline(
|
2017-02-15 03:19:26 +02:00
|
|
|
Options
|
|
|
|
);
|