1
0
mirror of https://github.com/yldio/copilot.git synced 2024-09-21 13:53:51 +03:00
copilot/packages/ui-toolkit/src/form/label.js
Sérgio Ramos f3e531dbd8 feat(cp-frontend,ui-toolkit): style inheritance using .extend (#458)
styled-components@2 exposes a new `.extend`[1] API. It is less problematic than
styled(Parent).

[1]: https://www.styled-components.com/docs/basics#extending-styles
2017-05-25 09:59:58 -05:00

23 lines
485 B
JavaScript

import React from 'react';
import { Subscriber } from 'react-broadcast';
import styled from 'styled-components';
import remcalc from 'remcalc';
import Label from '../label';
const StyledLabel = Label.extend`
margin-right: ${remcalc(12)};
`;
export default props => {
const render = value => {
const { id = '' } = value || {};
return <StyledLabel {...props} htmlFor={id} />;
};
return (
<Subscriber channel="input-group">
{render}
</Subscriber>
);
};