Added the disable style in the ConfigurationRow.jsx
This commit is contained in:
@ -2,7 +2,7 @@ import "./styles.sass";
|
|||||||
import {faSquareRootVariable} from "@fortawesome/free-solid-svg-icons";
|
import {faSquareRootVariable} from "@fortawesome/free-solid-svg-icons";
|
||||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "input", options, value, setValue}) => {
|
export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "input", options, value, setValue, disabled}) => {
|
||||||
return (
|
return (
|
||||||
<div className="configuration-row">
|
<div className="configuration-row">
|
||||||
<div className="left-area">
|
<div className="left-area">
|
||||||
@ -10,7 +10,8 @@ export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "inp
|
|||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{type === "select" && <select className="input-field" value={value} onChange={(e) => setValue(e.target.value)}>
|
{type === "select" && <select className="input-field" value={value} onChange={(e) => setValue(e.target.value)}
|
||||||
|
disabled={disabled}>
|
||||||
{options.map((option) =>
|
{options.map((option) =>
|
||||||
option.value ? <option value={option.value} key={option.value}>{option.text}</option>
|
option.value ? <option value={option.value} key={option.value}>{option.text}</option>
|
||||||
: <option key={option}>{option}</option>
|
: <option key={option}>{option}</option>
|
||||||
@ -18,7 +19,7 @@ export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "inp
|
|||||||
</select>}
|
</select>}
|
||||||
|
|
||||||
{type === "input" && <input className="input-field" type="text" placeholder={text} value={value}
|
{type === "input" && <input className="input-field" type="text" placeholder={text} value={value}
|
||||||
onChange={(e) => setValue(e.target.value)} />}
|
onChange={(e) => setValue(e.target.value)} disabled={disabled}/>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
Reference in New Issue
Block a user