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

Configure react context for elections query #48

Closed
cfech opened this issue Jun 30, 2023 · 2 comments
Closed

Configure react context for elections query #48

cfech opened this issue Jun 30, 2023 · 2 comments
Assignees

Comments

@cfech
Copy link
Collaborator

cfech commented Jun 30, 2023

No description provided.

@cfech
Copy link
Collaborator Author

cfech commented Jun 30, 2023

Completed:

UI

  • Removed global 2 rem border
  • Search button stays disabled when the text box has no text
  • Created CivicInfor.tsx with basic mui grid and share context with this page, added this to the navbar
  • Removed Home from navbar and set the site text to navigate home
  • Renamed/refactored homePageSearchBar to be AddressSearchBar this component is shared between the home page and the civic info page
  • Added the AddressSearchBar to the civics info page, if something is queried from this page there will be no redirection
  • Updated search bar title from generic vite one to Civics Central

API Calls

  • Queried available elections api
  • Created interface for available elections response
  • Configured available elections api call to run after representatives call has completed and set it in context
  • Home page will navigate to /civicInformation after both calls succeed

Context

  • Refactored/renamed GlobalContext to GlobalContextWrapper
  • Moved mui context into a class called ThemeContextWrapper
  • Created AvailableElectionsContextWrapper to hold context for available elections query, this wrapper wraps all the children of the app component in order to be able to use this data anywhere we need it
  • Wrote custom hooks for access to available election getter and setter
  • When civicInformation page loads, the data from the representatives endpoint and the elections endpoint are dumped in the console from that state held in react context

cfech added a commit that referenced this issue Jun 30, 2023
@cfech cfech added Completed and removed Doing labels Jun 30, 2023
cfech added a commit that referenced this issue Jun 30, 2023
cfech added a commit that referenced this issue Jun 30, 2023
@cfech
Copy link
Collaborator Author

cfech commented Jun 30, 2023

Other:

  • deployed updates
  • fixed security vulnerability in an npm package

drkchn added a commit that referenced this issue Jul 1, 2023
@cfech cfech closed this as completed Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant