aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/input.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-02 08:25:50 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-02 08:25:50 +0800
commit073a96cf63a8b2e5639d15133d09545f7bde1388 (patch)
tree8c2250740101b6b26e3d48745e06bca46e59260d /packages/website/ts/components/ui/input.tsx
parent817d9b0d3e1becdb2e8dbf51caa09edab8d14ab0 (diff)
downloaddexon-sol-tools-073a96cf63a8b2e5639d15133d09545f7bde1388.tar.gz
dexon-sol-tools-073a96cf63a8b2e5639d15133d09545f7bde1388.tar.zst
dexon-sol-tools-073a96cf63a8b2e5639d15133d09545f7bde1388.zip
Implement subscription form
Diffstat (limited to 'packages/website/ts/components/ui/input.tsx')
-rw-r--r--packages/website/ts/components/ui/input.tsx43
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..75a453eae
--- /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.placeholder};
+ }
+`;
+
+Input.defaultProps = {
+ width: 'auto',
+ backgroundColor: colors.white,
+ fontColor: colors.darkestGrey,
+ placeholderColor: colors.grey500,
+ fontSize: '12px',
+};
+
+Input.displayName = 'Input';