Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

Tamir198
Copy link
Contributor

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 :

image

Copy link

@github-actions github-actions bot left a 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.

@Tamir198 Tamir198 changed the title Add upload form feat: poll | Add upload form Jun 12, 2024
@Tamir198
Copy link
Contributor Author

@ArkadiK94 Can you add code review ?

Copy link
Contributor

@ArkadiK94 ArkadiK94 left a 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/FormInput.jsx Outdated Show resolved Hide resolved
src/components/Feeds/FeedPoll/uploadPollForm/FormInput.jsx Outdated Show resolved Hide resolved
src/components/Feeds/FeedPoll/uploadPollForm/FormInput.jsx Outdated Show resolved Hide resolved
src/components/Feeds/FeedPoll/uploadPollForm/FormInput.jsx Outdated Show resolved Hide resolved
};

const addAnswer = () => {
setAnswers((prevAnswers) => [...prevAnswers, prevAnswers.length + 1]);
Copy link
Contributor

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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use it?

Copy link
Contributor Author

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

@ArkadiK94 ArkadiK94 marked this pull request as draft June 28, 2024 15:40
@ArkadiK94 ArkadiK94 self-assigned this Jul 14, 2024
@ArkadiK94 ArkadiK94 removed their assignment Sep 1, 2024
@0xk4b1r 0xk4b1r deleted the branch th3cyb3rhub:dev September 6, 2024 14:50
@0xk4b1r 0xk4b1r closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants