joyent-portal/ui/src/components/list/outlet.js

32 lines
513 B
JavaScript
Raw Normal View History

2017-01-09 14:13:12 +02:00
const Column = require('../column');
2017-01-09 20:58:30 +02:00
const Styled = require('styled-components');
2017-01-09 14:13:12 +02:00
const React = require('react');
2017-01-09 20:58:30 +02:00
const {
default: styled
} = Styled;
2017-01-09 14:13:12 +02:00
2017-01-09 20:58:30 +02:00
const display = (props) => props.collapsed
? 'none'
: 'block';
const StyledColumn = styled(Column)`
display: ${display}
`;
const Outlet = (props) => (
<StyledColumn
name='list-item-outlet'
xs={6}
{...props}
>
{props.children}
</StyledColumn>
);
2017-01-09 14:13:12 +02:00
Outlet.propTypes = {
2017-01-09 20:58:30 +02:00
children: React.PropTypes.node
2017-01-09 14:13:12 +02:00
};
module.exports = Outlet;