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: use new vote mutation and add useVote hook #2909

Merged
merged 14 commits into from
Apr 4, 2024
Merged

Conversation

capJavert
Copy link
Contributor

@capJavert capJavert commented Apr 2, 2024

Changes

Describe what this PR does

  • adapting current vote hooks to new mutation
  • new useVote hook
    • exposes onMutate for optimistic UI
    • uses new vote mutation with entity
  • current useVotePost uses useVote under the hood (can be future refactored) and serves as implementation example for other entity hooks
  • comment vote and downvote will be implemented in separate PR

Events

Did you introduce any new tracking events?
Don't forget to update the Analytics Taxonomy sheet

Log the new/changed events below:

Type event_name value
Change/New event name extra: { ... }

Please make sure existing components are not breaking/affected by this PR

Manual Testing

On those affected packages:

  • Have you done sanity checks in the webapp?
  • Have you done sanity checks in the extension?
  • Does this not break anything in companion?

Did you test the modified components media queries?

  • MobileL (420px)
  • Tablet (656px)
  • Laptop (1020px)

Did you test on actual mobile devices?

  • iOS (Chrome and Safari)
  • Android

AS-213 #done

Preview domain

https://as-213-vote-mutation.preview.app.daily.dev

@capJavert capJavert self-assigned this Apr 2, 2024
Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 9:10am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) Apr 4, 2024 9:10am

@capJavert
Copy link
Contributor Author

Have to test once over but should be ready for review.

@capJavert capJavert marked this pull request as ready for review April 2, 2024 15:17
@capJavert capJavert requested a review from a team as a code owner April 2, 2024 15:17
Copy link
Member

@sshanzel sshanzel left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🚀

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Nothing blocking :)

packages/shared/src/hooks/vote/types.ts Show resolved Hide resolved
packages/shared/src/components/post/PostActions.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@nensidosari nensidosari left a comment

Choose a reason for hiding this comment

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

Looks good to me as well

@capJavert capJavert enabled auto-merge (squash) April 4, 2024 09:07
@capJavert capJavert merged commit 888c466 into main Apr 4, 2024
10 checks passed
@capJavert capJavert deleted the AS-213-vote-mutation branch April 4, 2024 09:10
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.

4 participants