Make content box expandable
This commit is contained in:
parent
bd1530f0af
commit
4b9ccfd8cc
|
@ -23,7 +23,8 @@ function App() {
|
|||
},
|
||||
{
|
||||
name: "Content",
|
||||
dynamicState: useState("")
|
||||
dynamicState: useState(""),
|
||||
expandable: true
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import React, { useState } from "react";
|
|||
export interface ReviewFieldProps {
|
||||
name: string;
|
||||
dynamicState: [string, React.Dispatch<React.SetStateAction<string>>];
|
||||
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);
|
||||
})}
|
||||
|
|
Loading…
Reference in a new issue