-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: poll | Add upload form #860
Conversation
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.
It's great having you contribute to this project
🌟 Welcome to the community 🌟
- If you would like to continue contributing to open source and would like to do it with an awesome inclusive community.
- You should join our Discord chat and our GitHub Organisation.
- We help and encourage each other to contribute to open source little and often 😄.
- Any questions let us know.
@ArkadiK94 Can you add code review ? |
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.
@Tamir198 Thank you very much 👍
I have some comments.
src/components/Feeds/FeedPoll/uploadPollForm/UploadPollForm.jsx
Outdated
Show resolved
Hide resolved
src/components/Feeds/FeedPoll/uploadPollForm/UploadPollForm.jsx
Outdated
Show resolved
Hide resolved
}; | ||
|
||
const addAnswer = () => { | ||
setAnswers((prevAnswers) => [...prevAnswers, prevAnswers.length + 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 think you should store the number of answers as number and not array
you don't get anything from storing it as [1,2,3]... why not 3 instead?
<Form onSubmit={handleSubmit(onSubmit)}> | ||
<Title>Add a question</Title> | ||
<QuestionBody | ||
errorMessage={errors?.question?.message} |
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.
Do you use it?
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.
Yes, try to submit short question
Fix issue #841
This is the form (right now not connected to any backend) :
pollUplode.mp4
Right now, the Zod validation validates things in a kind of "hardcoded way," but since the maximum number of answers won't change often, I think it's okay. I can think of other solutions if we want to implement dynamic answer numbers.
Also, it`s not in the video but there is a check for the minimum question length :