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

Rewrite table to functional component #326

Merged
merged 1 commit into from
Jun 4, 2020
Merged

Rewrite table to functional component #326

merged 1 commit into from
Jun 4, 2020

Conversation

Joozty
Copy link
Member

@Joozty Joozty commented May 14, 2020

No description provided.

@vercel
Copy link

vercel bot commented May 14, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oacore/dashboard/a9xlzrg5o
✅ Preview: https://dashboard-git-table-functional.oacore.now.sh

Copy link
Member

@viktor-yakubiv viktor-yakubiv left a comment

Choose a reason for hiding this comment

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

I would rather create a few components that accept raw data and just render it and do the data/request management somehow separate.

@Joozty
Copy link
Member Author

Joozty commented May 14, 2020

@viktor-yakubiv It's basically the second commit b7036c6

The idea is to make the table as dumb as possible. It's kind of part of #260. There should be two table hooks - useDynamicData() and useStaticData(). First mentioned is created in second commit. The later one will be added in the near future as we want to show invited people in settings and this data is static.

@Joozty
Copy link
Member Author

Joozty commented May 20, 2020

@viktor-yakubiv Sorry it's one big commit. I didn't have a clear idea of how to refactor it so I used different approaches and everything ended up in one commit.

I don't expect you to go through the whole code. Maybe just take a brief look if it is now more readable. I am not sure about it, to be honest. I managed to create small component/hooks and reduce the size of the table file. The most important change is useDymanicData hook. I moved data loading outside of the table and all related state is passed as a props. This can help us to use static data as well and eventually removed Pages (although I don't know how to replace it with something better yet)

@Joozty Joozty marked this pull request as ready for review May 20, 2020 12:17
@Joozty Joozty force-pushed the table-functional branch from 2b4e0a2 to 2b6f94a Compare May 20, 2020 12:48
Copy link
Member

@viktor-yakubiv viktor-yakubiv left a comment

Choose a reason for hiding this comment

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

It looks okay to me. However, I am afraid of conflicts if push this forward before #335 and #336

@Joozty
Copy link
Member Author

Joozty commented May 20, 2020

I will wait and handle conflicts here. No problem. Thanks for looking into it. :)

@Joozty Joozty added the 🚧 in progress PR which shouldn't be merged yet label May 20, 2020
@Joozty Joozty force-pushed the table-functional branch from 2b6f94a to 939b291 Compare May 22, 2020 12:46
@Joozty Joozty changed the base branch from master to request-premium-form May 22, 2020 12:47
@Joozty Joozty removed the 🚧 in progress PR which shouldn't be merged yet label May 22, 2020
@viktor-yakubiv viktor-yakubiv force-pushed the request-premium-form branch from c003a15 to 065ed6d Compare May 22, 2020 14:41
@Joozty Joozty force-pushed the table-functional branch from 939b291 to 0f00b45 Compare May 22, 2020 18:52
@Joozty Joozty force-pushed the table-functional branch from bc3cc36 to d38ae90 Compare June 4, 2020 09:19
@Joozty Joozty merged commit b156805 into master Jun 4, 2020
@Joozty Joozty deleted the table-functional branch June 4, 2020 10:39
@Joozty
Copy link
Member Author

Joozty commented Jun 4, 2020

I hope I resolved all conflicts correctly. Feel free to assign any bug with a table directly to me.

@viktor-yakubiv
Copy link
Member

Thanks a lot for maintaining all the conflicts for such a long time! 👍

I hope this PR is as big improvement as we hope 😄

@viktor-yakubiv viktor-yakubiv mentioned this pull request Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactoring Restructuring, cleaning up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants