aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/amount_input.tsx
blob: 699541bfb19eb3f4eb9f6b40649294ff325614ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { BigNumber } from '@0xproject/utils';
import * as React from 'react';

import { ColorOption } from '../style/theme';

import { Container, Flex, Input, Text } from './ui';

export interface AmountInputProps {
    fontColor?: ColorOption;
    fontSize?: string;
    value?: BigNumber;
    onChange?: (value: BigNumber) => void;
}

export const AmountInput: React.StatelessComponent<AmountInputProps> = props => (
    <Container borderBottom="1px solid rgba(255,255,255,0.3)" display="inline-block">
        <Input
            fontColor={props.fontColor}
            fontSize={props.fontSize}
            value={props.value ? props.value.toString() : undefined}
            placeholder="0.00"
            width="2em"
        />
    </Container>
);

AmountInput.defaultProps = {};