-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add form and return JSON #12
base: master
Are you sure you want to change the base?
Conversation
@PrajwalArali is attempting to deploy a commit to the hikartik2004's projects Team on Vercel. A member of the Team first needs to authorize it. |
Hi @PrajwalArali, I see you're handling most fields which accept simple single input, but missed the ones which are arrays.
Let me know if you need more clarity. |
You can also handle the update portfolio json logic, the implementation is here Simply replace the value of the key named |
@@ -10,7 +10,7 @@ | |||
}, | |||
"dependencies": { | |||
"@babel/standalone": "^7.23.3", | |||
"@clerk/nextjs": "^4.27.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to change the versions too
But no worries, I'll ignore them during merge.
const ManualEditPage = () => { | ||
const [formData, setFormData] = useState({ | ||
FirstName: "", | ||
LastName: "", | ||
NavName: "", | ||
NavSubtitle: "", | ||
image: "", | ||
AboutImageLeft: "", | ||
AboutImageCenter: "", | ||
AboutImageRight: "", | ||
linkedinUrl: "", | ||
resumeLink: "", | ||
githubId: "", | ||
email: "", | ||
WhatsAppLink: "", | ||
HeroGradient: "", | ||
HeroTitle: "", | ||
HeroSubtitle: "", | ||
AboutTitle: "", | ||
AboutTitleGradient: "", | ||
AboutMockCode: "", | ||
AboutBadge: "", | ||
AboutDescription: "", | ||
AboutMainDescription: "", | ||
AboutOtherDescription: "", | ||
ProjectTitle: "", | ||
ProjectTitleGradient: "", | ||
ProjectDescription: "", | ||
ProjectBadge: "", | ||
SkillsBadge: "", | ||
FooterDescription: "", | ||
FooterBadge: "", | ||
FootTitle: "", | ||
FooterSliderTitle: "", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer #11 for all the fields required in the form
const handleSubmit = (e) => { | ||
e.preventDefault(); | ||
console.log("Generated JSON:", JSON.stringify(formData, null, 2)); | ||
alert("JSON generated! Check the console for details."); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle update portfolio code in firestore!
Function to do the same
<input | ||
type="text" | ||
id={key} | ||
name={key} | ||
value={formData[key]} | ||
onChange={handleChange} | ||
placeholder={`Enter ${key}`} | ||
className="w-full px-4 py-3 rounded bg-gray-900 text-white border border-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-500" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Their is a component <Input />
(note capital i)
Use it instead for standard styling across the whole app.
Closes Issue
Closes #11
Description
Added Form that takes the user input and logged them at console in JSON format.
/my-portfolio/manual-edit