From dfb037a1d29da56f604415b12f97dd04bb2b0f24 Mon Sep 17 00:00:00 2001 From: eliabejr Date: Mon, 21 Jan 2019 15:43:25 -0300 Subject: [PATCH] feat(send-view-additional-options): add bgColor optional prop --- app/components/input.js | 22 ++++++++++++++++++---- app/components/select.js | 23 +++++++++++++++-------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/app/components/input.js b/app/components/input.js index a9917f2..7eef5f5 100644 --- a/app/components/input.js +++ b/app/components/input.js @@ -3,12 +3,14 @@ import React from 'react'; import styled from 'styled-components'; +import theme from '../theme'; + const getDefaultStyles = t => styled[t]` border-radius: ${// $FlowFixMe props => props.theme.boxBorderRadius}; border: none; background-color: ${// $FlowFixMe - props => props.theme.colors.inputBackground}; + props => props.bgColor || props.theme.colors.inputBackground}; color: ${// $FlowFixMe props => props.theme.colors.text}; padding: 15px; @@ -34,15 +36,26 @@ type Props = { disabled?: boolean, type?: string, step?: number, + bgColor?: string, }; -export const InputComponent = ({ inputType, onChange, ...props }: Props) => { +export const InputComponent = ({ + inputType, onChange, bgColor, ...props +}: Props) => { const inputTypes = { input: () => ( - onChange(evt.target.value)} {...props} /> + onChange(evt.target.value)} + bgColor={bgColor} + {...props} + /> ), textarea: () => ( -