Created
January 10, 2017 20:31
-
-
Save xcoderzach/9754c27af72a8cdbef65c1fcde322c61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import * as ui from './ui' | |
export default const FormField = ({ | |
Container = ui.Container, | |
Label = ui.Label, | |
Input = ui.Input | |
}) => | |
({ type, label, value, onChange }) => ( | |
<Container> | |
<Label>{label}</Label> | |
<Input type={type} value={value} onChange={onChange} /> | |
</Container> | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
export const Container = styled.div` | |
margin: 20px; | |
` | |
export const Input = styled.input` | |
border: 1px solid tomato; | |
background-color: cream; | |
` | |
export const Label = styled.label` | |
font-size: 12px; | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment