aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/amount_input.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-05 09:57:40 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-05 09:57:40 +0800
commitc5084f023ac0356660b9480f9e1f477001a61284 (patch)
treeb635b3d086ad0a18445d336b82abb06a62b8e87d /packages/instant/src/components/amount_input.tsx
parentbf0437324d3499dbb516e85a4eb1fbdceb91707c (diff)
downloaddexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar.gz
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar.bz2
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar.lz
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar.xz
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.tar.zst
dexon-sol-tools-c5084f023ac0356660b9480f9e1f477001a61284.zip
Add Input and AmountInput component
Diffstat (limited to 'packages/instant/src/components/amount_input.tsx')
-rw-r--r--packages/instant/src/components/amount_input.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/instant/src/components/amount_input.tsx b/packages/instant/src/components/amount_input.tsx
new file mode 100644
index 000000000..699541bfb
--- /dev/null
+++ b/packages/instant/src/components/amount_input.tsx
@@ -0,0 +1,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 = {};