From 4b9ccfd8ccb765b9a2babdabdeb024c09cf97ef8 Mon Sep 17 00:00:00 2001 From: powermaker450 Date: Thu, 29 Aug 2024 20:59:56 +0000 Subject: [PATCH] Make content box expandable --- src/App.tsx | 3 ++- src/components/ReviewField.tsx | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index de98587..5830a12 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,8 @@ function App() { }, { name: "Content", - dynamicState: useState("") + dynamicState: useState(""), + expandable: true } ]; diff --git a/src/components/ReviewField.tsx b/src/components/ReviewField.tsx index a4eac8c..1dad117 100644 --- a/src/components/ReviewField.tsx +++ b/src/components/ReviewField.tsx @@ -4,6 +4,7 @@ import React, { useState } from "react"; export interface ReviewFieldProps { name: string; dynamicState: [string, React.Dispatch>]; + expandable?: boolean; variant?: "outlined" | "filled" | "standard"; help?: string; } @@ -25,6 +26,7 @@ const ReviewField = ({ fields }: ReviewFieldOpts) => { key={field.name} label={field.name} value={field.dynamicState[0]} + multiline={field.expandable ?? false} onChange={(({ target }) => { field.dynamicState[1](target.value); })}