// @flow import React from 'react'; import styled from 'styled-components'; const getDefaultStyles = t => styled[t]` border-radius: ${// $FlowFixMe props => props.theme.boxBorderRadius}; border: none; background-color: ${// $FlowFixMe props => props.theme.colors.inputBackground}; color: ${// $FlowFixMe props => props.theme.colors.text}; padding: 15px; width: 100%; outline: none; font-family: ${// $FlowFixMe props => props.theme.fontFamily}; ::placeholder { opacity: 0.5; } `; const Input = getDefaultStyles('input'); const Textarea = getDefaultStyles('textarea'); type Props = { inputType?: 'input' | 'textarea', value: string, onChange: string => void, onFocus?: (SyntheticFocusEvent) => void, rows?: number, disabled?: boolean, type?: string, step?: number, }; export const InputComponent = ({ inputType, onChange, ...props }: Props) => { const inputTypes = { input: () => ( onChange(evt.target.value)} {...props} /> ), textarea: () => (