Skip to content

Commit

Permalink
conditional fields show
Browse files Browse the repository at this point in the history
  • Loading branch information
devsisingh committed May 24, 2024
1 parent 36ffeae commit 096a784
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/nodeform/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ const Page = () => {

const [showPopup, setShowPopup] = useState(false);

const [showothers, setshowothers] = useState(false);

// Handler functions for checkbox click events
const handleYesChange = () => {
setChecked("yes");
setshowothers(true);
};

const handleNoChange = () => {
setChecked("no");
setshowothers(false);
};

// Handler function for form submission
Expand Down Expand Up @@ -169,6 +173,9 @@ const Page = () => {
</label>
</div>

{
showothers && (
<>
<div className="mt-10 text-xl">Tell us your project name</div>
<input
type="text"
Expand All @@ -188,8 +195,13 @@ const Page = () => {
className="mt-2 shadow border appearance-none rounded-xl w-full py-4 px-6 text-gray-200 leading-tight focus:outline-none focus:shadow-outline"
style={{ color: "black", backgroundColor: "#0B6A604D" }}
/>
</>
)
}

<div className="flex justify-between gap-4">
{
showothers && (
<div className="w-1/2">
<div className="mt-10 text-xl">Node Region *</div>
<input
Expand All @@ -202,6 +214,8 @@ const Page = () => {
style={{ color: "black", backgroundColor: "#0B6A604D" }}
/>
</div>
)
}
<div className="w-1/2">
<div className="mt-10 text-xl">Twitter ID</div>
<input
Expand Down

0 comments on commit 096a784

Please sign in to comment.