2017-05-18 21:21:33 +03:00
|
|
|
import { Subscriber } from 'react-broadcast';
|
|
|
|
import typography from '../typography';
|
|
|
|
import Baseline from '../baseline';
|
|
|
|
import { Col } from 'react-styled-flexboxgrid';
|
|
|
|
import is from 'styled-is';
|
|
|
|
import remcalc from 'remcalc';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
|
2017-05-25 17:59:58 +03:00
|
|
|
const StyledCol = Col.extend`
|
2017-05-18 21:21:33 +03:00
|
|
|
${typography.fontFamily};
|
|
|
|
${typography.normal};
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
min-width: auto;
|
|
|
|
max-width: ${remcalc(480)};
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
|
|
${is('collapsed')`
|
|
|
|
display: none;
|
|
|
|
`};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Outlet = ({ children, ...rest }) => {
|
2017-06-12 01:58:22 +03:00
|
|
|
const render = ({ collapsed = false }) =>
|
2017-05-18 21:21:33 +03:00
|
|
|
<StyledCol name="card-outlet" collapsed={collapsed} xs={6} {...rest}>
|
|
|
|
{children}
|
2017-06-12 01:58:22 +03:00
|
|
|
</StyledCol>;
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Subscriber channel="card">
|
|
|
|
{render}
|
|
|
|
</Subscriber>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
Outlet.propTypes = {
|
|
|
|
children: PropTypes.node,
|
|
|
|
collapsed: PropTypes.bool
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Baseline(Outlet);
|