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

Convert GraphQL calls to API calls for HeaderFeed.js #193

Open
yu-nix opened this issue Mar 29, 2022 · 0 comments
Open

Convert GraphQL calls to API calls for HeaderFeed.js #193

yu-nix opened this issue Mar 29, 2022 · 0 comments
Assignees

Comments

@yu-nix
Copy link
Member

yu-nix commented Mar 29, 2022

This components makes queries for user data. With the API system, this will make a GET request to get user data. In order to get their team, an additional GET request will be made to get the team by user.

The component itself will have a QueryRenderer, but as we are using the API, that is not necessary. The only parts of the component needed should be within the innermost return. The props in the component relate to the graphQL query, and so their values will have to be adjusted depending on how you decide to store the data received from the GET requests.

Unlike the graphQL queries, these functions should be within the class.

This component should also be converted to a functional component as React seems to favor them. Here are some links that describe the differences between the two how to go about converting them.

https://nimblewebdeveloper.com/blog/convert-react-class-to-function-component

https://egghead.io/lessons/react-migrate-a-react-class-component-to-a-function-component

If you want internal references, the Prizes and Ballot(timber) repos use functional components on their client end.

If you'd like to convert a component to typescript, you may, but that may require features that the current repo is too outdated for. I am currently working on updating it so that you may use the necessary features to maintain typing and the like.

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

No branches or pull requests

2 participants