diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-06 17:30:57 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-06 17:30:57 +0800 |
commit | 787eec8be4d1318b87bb1edfa1ac9c8689297ccb (patch) | |
tree | c5f689ff8d277a8f88645624b4e1162e3cb45efc /packages/website/ts/components/ui/input.tsx | |
parent | 25f62daf146895a1e0e0c966166f08f28467ae2e (diff) | |
parent | cc39eea9991306eabadd912256452f67fb49c20b (diff) | |
download | dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar.gz dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar.bz2 dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar.lz dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar.xz dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.tar.zst dexon-0x-contracts-787eec8be4d1318b87bb1edfa1ac9c8689297ccb.zip |
Merge v2-prototype
Diffstat (limited to 'packages/website/ts/components/ui/input.tsx')
-rw-r--r-- | packages/website/ts/components/ui/input.tsx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/website/ts/components/ui/input.tsx b/packages/website/ts/components/ui/input.tsx new file mode 100644 index 000000000..e01a71a53 --- /dev/null +++ b/packages/website/ts/components/ui/input.tsx @@ -0,0 +1,43 @@ +import { colors } from '@0xproject/react-shared'; +import * as React from 'react'; +import { styled } from 'ts/style/theme'; + +export interface InputProps { + className?: string; + value?: string; + width?: string; + fontSize?: string; + fontColor?: string; + placeholderColor?: string; + placeholder?: string; + backgroundColor?: string; + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void; +} + +const PlainInput: React.StatelessComponent<InputProps> = ({ value, className, placeholder, onChange }) => ( + <input className={className} value={value} onChange={onChange} placeholder={placeholder} /> +); + +export const Input = styled(PlainInput)` + font-size: ${props => props.fontSize}; + width: ${props => props.width}; + padding: 0.8em 1.2em; + border-radius: 3px; + font-family: 'Roboto Mono'; + color: ${props => props.fontColor}; + border: none; + background-color: ${props => props.backgroundColor}; + &::placeholder { + color: ${props => props.placeholderColor}; + } +`; + +Input.defaultProps = { + width: 'auto', + backgroundColor: colors.white, + fontColor: colors.darkestGrey, + placeholderColor: colors.darkGrey, + fontSize: '12px', +}; + +Input.displayName = 'Input'; |