From 23c41077637b6e061e61d99c0e3d8b1b7b09ac62 Mon Sep 17 00:00:00 2001 From: Abhay Raizada Date: Fri, 22 Mar 2024 07:00:38 +0530 Subject: [PATCH] Fix input colors in dark mode --- components/Inputs/Inputs.tsx | 31 ++++++++++++++---------- components/PrescriptionCreator/index.tsx | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/components/Inputs/Inputs.tsx b/components/Inputs/Inputs.tsx index 81cd94c..4bab14b 100644 --- a/components/Inputs/Inputs.tsx +++ b/components/Inputs/Inputs.tsx @@ -21,11 +21,14 @@ export const InputFiller: React.FC = ({ const handleInputChange = ( e: any ) => { - setInputValue(e.target.value) + console.log("E is", e) + setInputValue(e.target.value); + onChange(e.target.value) }; - const handleValueChange = (value: string | null) => { + const handleValueChange = (value: string) => { if (!value) return; + setInputValue(value) onChange(value); }; @@ -41,19 +44,21 @@ export const InputFiller: React.FC = ({ [AnswerTypes.label]: <>, [AnswerTypes.shortText]: ( - + onChange={handleValueChange} + defaultValue={defaultValue as string} + placeholder="enter a value..." + placeholderTextColor="#aaaaaa"> + ), [AnswerTypes.paragraph]: ( + rows={10} + placeholder="enter a value.." + placeholderTextColor="#aaaaaa" + onChange={handleInputChange} + autoHeight + style={{ paddingVertical: 5 }} + /> ), [AnswerTypes.number]: ( // = ({ ), [AnswerTypes.dropdown]: ( { setInputValue(value), console.log("selected value is: ", value)}} + onValueChange={handleValueChange} items={dropdownItems} placeholder={{}} key="picker" diff --git a/components/PrescriptionCreator/index.tsx b/components/PrescriptionCreator/index.tsx index baee581..b1ce767 100644 --- a/components/PrescriptionCreator/index.tsx +++ b/components/PrescriptionCreator/index.tsx @@ -96,7 +96,7 @@ export const PrescriptionCreator = ({form} : {form: any}) => { }}> {field.question}