diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-03 08:56:49 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-03 08:56:49 +0800 |
commit | edb3a613879ecb4ae077dc4e4256965de2092e48 (patch) | |
tree | b7860f548c5399238d466f51241d86720b3a87a2 /packages/website/ts/pages/instant/config_generator_address_input.tsx | |
parent | 89f67b9becf3b4c0d13cceeaca4d5656ad500a9a (diff) | |
parent | 1ddf1087dd327b2ef35165518ee91eb457b84174 (diff) | |
download | dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar.gz dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar.bz2 dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar.lz dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar.xz dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.tar.zst dexon-sol-tools-edb3a613879ecb4ae077dc4e4256965de2092e48.zip |
Merge branch 'development' into feature/instant/tell-amount-available
Diffstat (limited to 'packages/website/ts/pages/instant/config_generator_address_input.tsx')
-rw-r--r-- | packages/website/ts/pages/instant/config_generator_address_input.tsx | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/packages/website/ts/pages/instant/config_generator_address_input.tsx b/packages/website/ts/pages/instant/config_generator_address_input.tsx index ccbaf4482..890e39da6 100644 --- a/packages/website/ts/pages/instant/config_generator_address_input.tsx +++ b/packages/website/ts/pages/instant/config_generator_address_input.tsx @@ -1,11 +1,13 @@ -import { colors } from '@0x/react-shared'; import { addressUtils } from '@0x/utils'; import * as _ from 'lodash'; import * as React from 'react'; +import styled from 'styled-components'; + +import { colors } from 'ts/style/colors'; import { Container } from 'ts/components/ui/container'; -import { Input } from 'ts/components/ui/input'; -import { Text } from 'ts/components/ui/text'; + +import { Paragraph } from 'ts/components/text'; export interface ConfigGeneratorAddressInputProps { value?: string; @@ -16,6 +18,19 @@ export interface ConfigGeneratorAddressInputState { errMsg: string; } +export interface InputProps { + className?: string; + value?: string; + width?: string; + fontSize?: string; + fontColor?: string; + padding?: string; + placeholderColor?: string; + placeholder?: string; + backgroundColor?: string; + onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void; +} + export class ConfigGeneratorAddressInput extends React.Component< ConfigGeneratorAddressInputProps, ConfigGeneratorAddressInputState @@ -26,22 +41,13 @@ export class ConfigGeneratorAddressInput extends React.Component< public render(): React.ReactNode { const { errMsg } = this.state; const hasError = !_.isEmpty(errMsg); - const border = hasError ? '1px solid red' : undefined; return ( <Container height="80px"> - <Input - width="100%" - fontSize="16px" - padding="0.7em 1em" - value={this.props.value} - onChange={this._handleChange} - placeholder="0xe99...aa8da4" - border={border} - /> + <Input value={this.props.value} onChange={this._handleChange} placeholder="0xe99...aa8da4" /> <Container marginTop="5px" isHidden={!hasError} height="25px"> - <Text fontSize="14px" fontColor={colors.grey} fontStyle="italic"> + <Paragraph size="small" isNoMargin={true}> {errMsg} - </Text> + </Paragraph> </Container> </Container> ); @@ -57,3 +63,22 @@ export class ConfigGeneratorAddressInput extends React.Component< this.props.onChange(address, isValidAddress); }; } + +const PlainInput: React.StatelessComponent<InputProps> = ({ value, className, placeholder, onChange }) => ( + <input className={className} value={value} onChange={onChange} placeholder={placeholder} /> +); + +export const Input = styled(PlainInput)` + background-color: ${colors.white}; + color: ${colors.textDarkSecondary}; + font-size: 1rem; + width: 100%; + padding: 16px 20px 18px; + border-radius: 4px; + border: 1px solid transparent; + outline: none; + &::placeholder { + color: #333333; + opacity: 0.5; + } +`; |