-
-
Notifications
You must be signed in to change notification settings - Fork 30
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: add home page and profile page #36
Conversation
divider from tailiwind are based on border, often times it's not centered enough because the padding is not balanced between dividers, here I tried to balance it using this plugin. It also can adjust the amount padding needed.
+ move token retrieval in custom hooks useAuth + add custom hooks to check current tab is github profile url and opensauced user + add activeTab permission to manifest.json to check url of current tab from extension popup + refactor routing logic to use context api, so it can be used anywhere without prop drilling + refactor setRenderedPage to accept props, because I need to pass username to profile page + wrap setRenderedPage with setCurrentPage function to make it easy if we want to update route state without passing props + add new util cacheFetch to be able cache data from api, reducing api calls. + add isOpenSaucedUser function for ease of use and clarity
+ add getUserData on fetchOpenSaucedApiData to fetch more detailed user data + add getUserPRData to fetch user PR data Note: I use inline styling 'flexWrap' in profile page because it's interfering with github page (again) maybe we should use shadow DOM approach?
to make it work
Thank you for adding changes to this PR, I totally missed that. and thank you for spending time to look into this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great @doaortu. Some small copy fixes requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff @doaortu. I've suggested some changes for you to consider.
I fell extremely sick yesterday and wasn't able to contribute much, will try to review this tonight and catch up. |
Co-authored-by: Brian Douglas <[email protected]>
Co-authored-by: Brian Douglas <[email protected]> Co-authored-by: Anush <[email protected]>
Co-authored-by: Brian Douglas <[email protected]>
Co-authored-by: Anush <[email protected]>
Changes: + Replaced || with ?? to avoid a falsy result when expiry is set to 0 seconds. + Replaced localStorage with chrome.storage.local . + Combined the text/*, application/json check into a single match() call. + Formatted the file with semi-colons(Linting will be added soon, so this shouldn't be a problem). Co-authored-by: Anush <[email protected]>
Co-authored-by: Anush <[email protected]>
Co-authored-by: Anush <[email protected]>
Suggestion: Using Promise.all() will prove useful here as the calls can be made simultaneously Co-authored-by: Anush <[email protected]>
@doaortu, your suggestion to use https://www.npmjs.com/package/react-chrome-extension-router for routing through the extension pages can prove really beneficial as the extension pages grow. We'll definitely keep this option in mind moving forward. Thank you. |
match api response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally this works. I think we can go with this and get user feedback from the discord.
@doaortu thanks for the features. Please consider adding this PR to your highlights feed. |
Thank you for merging this PR.. Sure, I'll add PRs I've made in the highlights after this. Thanks for the suggestion. |
## 1.0.0-beta.1 (2023-04-27) ### π Documentation * README and LICENSE ([917f7b0](917f7b0)) * Updated the README.md ([#15](#15)) ([3e4dd69](3e4dd69)) ### π Bug Fixes * rename the. extension ([294e499](294e499)) * Update URLs ([5828e20](5828e20)) * make emails less creepy ([a08fa45](a08fa45)) * re-enable tailwind base class on extension popup ([#31](#31)) ([c081217](c081217)) * Wrapped the await call in an async() ([#26](#26)) ([357aab5](357aab5)) ### π Features * add home page and profile page ([#36](#36)) ([8a43288](8a43288)) * Added a configuration file ([#32](#32)) ([ec6722c](ec6722c)) * Auto PAT authentication ([#29](#29)) ([f4f8cf6](f4f8cf6)) * extension window navigation ([#21](#21)) ([b5ae9a6](b5ae9a6)) * GitHub page update listener ([#37](#37)) ([06b070f](06b070f)) * Invite to OpenSauced ([#20](#20)) ([0c8f222](0c8f222)) * PAT authentication ([#27](#27)) ([e726a93](e726a93)) * updated the extension logo ([#22](#22)) ([d19034d](d19034d)) * view on OpenSauced button ([#14](#14)) ([a447551](a447551)) ### π Continuous Integration * automated github releases ([#39](#39)) ([735fa66](735fa66)), closes [#16](#16)
π This PR is included in version 1.0.0-beta.1 π The release is available on GitHub release Your semantic-release bot π¦π |
## 1.0.0 (2023-04-27) ### π Documentation * README and LICENSE ([917f7b0](917f7b0)) * Updated the README.md ([open-sauced#15](https://github.com/diivi/browser-extensions/issues/15)) ([3e4dd69](3e4dd69)) ### π Bug Fixes * rename the. extension ([294e499](294e499)) * Update URLs ([5828e20](5828e20)) * make emails less creepy ([a08fa45](a08fa45)) * re-enable tailwind base class on extension popup ([open-sauced#31](https://github.com/diivi/browser-extensions/issues/31)) ([c081217](c081217)) * Wrapped the await call in an async() ([open-sauced#26](https://github.com/diivi/browser-extensions/issues/26)) ([357aab5](357aab5)) ### π Features * add home page and profile page ([open-sauced#36](https://github.com/diivi/browser-extensions/issues/36)) ([8a43288](8a43288)) * Added a configuration file ([open-sauced#32](https://github.com/diivi/browser-extensions/issues/32)) ([ec6722c](ec6722c)) * Auto PAT authentication ([open-sauced#29](https://github.com/diivi/browser-extensions/issues/29)) ([f4f8cf6](f4f8cf6)) * extension window navigation ([open-sauced#21](https://github.com/diivi/browser-extensions/issues/21)) ([b5ae9a6](b5ae9a6)) * GitHub page update listener ([open-sauced#37](https://github.com/diivi/browser-extensions/issues/37)) ([06b070f](06b070f)) * Invite to OpenSauced ([open-sauced#20](https://github.com/diivi/browser-extensions/issues/20)) ([0c8f222](0c8f222)) * PAT authentication ([open-sauced#27](https://github.com/diivi/browser-extensions/issues/27)) ([e726a93](e726a93)) * updated the extension logo ([open-sauced#22](https://github.com/diivi/browser-extensions/issues/22)) ([d19034d](d19034d)) * view on OpenSauced button ([open-sauced#14](https://github.com/diivi/browser-extensions/issues/14)) ([a447551](a447551))
## 1.0.0 (2023-04-27) ### π Documentation * README and LICENSE ([917f7b0](917f7b0)) * Updated the README.md ([open-sauced#15](https://github.com/diivi/browser-extensions/issues/15)) ([3e4dd69](3e4dd69)) ### π Bug Fixes * rename the. extension ([294e499](294e499)) * Update URLs ([5828e20](5828e20)) * make emails less creepy ([a08fa45](a08fa45)) * re-enable tailwind base class on extension popup ([open-sauced#31](https://github.com/diivi/browser-extensions/issues/31)) ([c081217](c081217)) * Wrapped the await call in an async() ([open-sauced#26](https://github.com/diivi/browser-extensions/issues/26)) ([357aab5](357aab5)) ### π Features * add home page and profile page ([open-sauced#36](https://github.com/diivi/browser-extensions/issues/36)) ([8a43288](8a43288)) * Added a configuration file ([open-sauced#32](https://github.com/diivi/browser-extensions/issues/32)) ([ec6722c](ec6722c)) * Auto PAT authentication ([open-sauced#29](https://github.com/diivi/browser-extensions/issues/29)) ([f4f8cf6](f4f8cf6)) * extension window navigation ([open-sauced#21](https://github.com/diivi/browser-extensions/issues/21)) ([b5ae9a6](b5ae9a6)) * GitHub page update listener ([open-sauced#37](https://github.com/diivi/browser-extensions/issues/37)) ([06b070f](06b070f)) * Invite to OpenSauced ([open-sauced#20](https://github.com/diivi/browser-extensions/issues/20)) ([0c8f222](0c8f222)) * PAT authentication ([open-sauced#27](https://github.com/diivi/browser-extensions/issues/27)) ([e726a93](e726a93)) * updated the extension logo ([open-sauced#22](https://github.com/diivi/browser-extensions/issues/22)) ([d19034d](d19034d)) * view on OpenSauced button ([open-sauced#14](https://github.com/diivi/browser-extensions/issues/14)) ([a447551](a447551))
## 1.0.0 (2023-04-27) ### π Documentation * README and LICENSE ([917f7b0](917f7b0)) * Updated the README.md ([open-sauced#15](https://github.com/diivi/browser-extensions/issues/15)) ([3e4dd69](3e4dd69)) ### π Bug Fixes * rename the. extension ([294e499](294e499)) * Update URLs ([5828e20](5828e20)) * make emails less creepy ([a08fa45](a08fa45)) * re-enable tailwind base class on extension popup ([open-sauced#31](https://github.com/diivi/browser-extensions/issues/31)) ([c081217](c081217)) * Wrapped the await call in an async() ([open-sauced#26](https://github.com/diivi/browser-extensions/issues/26)) ([357aab5](357aab5)) ### π Features * add home page and profile page ([open-sauced#36](https://github.com/diivi/browser-extensions/issues/36)) ([8a43288](8a43288)) * Added a configuration file ([open-sauced#32](https://github.com/diivi/browser-extensions/issues/32)) ([ec6722c](ec6722c)) * Auto PAT authentication ([open-sauced#29](https://github.com/diivi/browser-extensions/issues/29)) ([f4f8cf6](f4f8cf6)) * extension window navigation ([open-sauced#21](https://github.com/diivi/browser-extensions/issues/21)) ([b5ae9a6](b5ae9a6)) * GitHub page update listener ([open-sauced#37](https://github.com/diivi/browser-extensions/issues/37)) ([06b070f](06b070f)) * Invite to OpenSauced ([open-sauced#20](https://github.com/diivi/browser-extensions/issues/20)) ([0c8f222](0c8f222)) * PAT authentication ([open-sauced#27](https://github.com/diivi/browser-extensions/issues/27)) ([e726a93](e726a93)) * updated the extension logo ([open-sauced#22](https://github.com/diivi/browser-extensions/issues/22)) ([d19034d](d19034d)) * view on OpenSauced button ([open-sauced#14](https://github.com/diivi/browser-extensions/issues/14)) ([a447551](a447551))
## 1.0.0 (2023-05-13) ### π Documentation * README and LICENSE ([917f7b0](917f7b0)) * Updated the README.md ([#15](#15)) ([3e4dd69](3e4dd69)) ### π Continuous Integration * automated github releases ([#39](#39)) ([735fa66](735fa66)), closes [#16](#16) ### π§βπ» Code Refactoring * improved-auth-strategy ([#56](#56)) ([d8b27c3](d8b27c3)) ### π Features * add home page and profile page ([#36](#36)) ([8a43288](8a43288)) * add to highlights button ([#64](#64)) ([e2120a1](e2120a1)) * Added a configuration file ([#32](#32)) ([ec6722c](ec6722c)) * Added light mode to GH profile buttons ([#40](#40)) ([a7ea43a](a7ea43a)) * Added linting to the project. ([#49](#49)) ([1f73007](1f73007)) * Auto PAT authentication ([#29](#29)) ([f4f8cf6](f4f8cf6)) * extension window navigation ([#21](#21)) ([b5ae9a6](b5ae9a6)) * GitHub page update listener ([#37](#37)) ([06b070f](06b070f)) * Invite to OpenSauced ([#20](#20)) ([0c8f222](0c8f222)) * PAT authentication ([#27](#27)) ([e726a93](e726a93)) * updated the extension logo ([#22](#22)) ([d19034d](d19034d)) * view on OpenSauced button ([#14](#14)) ([a447551](a447551)) * vote repos ([#70](#70)) ([ff2c8f4](ff2c8f4)) ### π Bug Fixes * rename the. extension ([294e499](294e499)) * Update URLs ([5828e20](5828e20)) * attach dist folder to release assets ([#47](#47)) ([4f50e72](4f50e72)) * circular-deps in vote buttons ([675496c](675496c)) * Duplicate buttons on GH profile page ([#48](#48)) ([9ee2dca](9ee2dca)) * incorrect request for voting ([#72](#72)) ([7a35014](7a35014)) * make emails less creepy ([a08fa45](a08fa45)) * re-enable tailwind base class on extension popup ([#31](#31)) ([c081217](c081217)) * remove activeTab manifest.json ([#50](#50)) ([dd71480](dd71480)) * render emojis in user bio ([#68](#68)) ([d0158a5](d0158a5)) * set-output deprecation warning ([#51](#51)) ([486f84b](486f84b)) * unrecognized-manifest-key ([#55](#55)) ([d622500](d622500)) * Wrapped the await call in an async() ([#26](#26)) ([357aab5](357aab5))
π This PR is included in version 1.0.0 π The release is available on GitHub release Your semantic-release bot π¦π |
## 1.0.0-beta.1 (2023-04-27) ### π Documentation * README and LICENSE ([917f7b0](open-sauced/ai@917f7b0)) * Updated the README.md ([#15](open-sauced/ai#15)) ([3e4dd69](open-sauced/ai@3e4dd69)) ### π Bug Fixes * rename the. extension ([294e499](open-sauced/ai@294e499)) * Update URLs ([5828e20](open-sauced/ai@5828e20)) * make emails less creepy ([a08fa45](open-sauced/ai@a08fa45)) * re-enable tailwind base class on extension popup ([#31](open-sauced/ai#31)) ([c081217](open-sauced/ai@c081217)) * Wrapped the await call in an async() ([#26](open-sauced/ai#26)) ([357aab5](open-sauced/ai@357aab5)) ### π Features * add home page and profile page ([#36](open-sauced/ai#36)) ([8a43288](open-sauced/ai@8a43288)) * Added a configuration file ([#32](open-sauced/ai#32)) ([ec6722c](open-sauced/ai@ec6722c)) * Auto PAT authentication ([#29](open-sauced/ai#29)) ([f4f8cf6](open-sauced/ai@f4f8cf6)) * extension window navigation ([#21](open-sauced/ai#21)) ([b5ae9a6](open-sauced/ai@b5ae9a6)) * GitHub page update listener ([#37](open-sauced/ai#37)) ([06b070f](open-sauced/ai@06b070f)) * Invite to OpenSauced ([#20](open-sauced/ai#20)) ([0c8f222](open-sauced/ai@0c8f222)) * PAT authentication ([#27](open-sauced/ai#27)) ([e726a93](open-sauced/ai@e726a93)) * updated the extension logo ([#22](open-sauced/ai#22)) ([d19034d](open-sauced/ai@d19034d)) * view on OpenSauced button ([#14](open-sauced/ai#14)) ([a447551](open-sauced/ai@a447551)) ### π Continuous Integration * automated github releases ([#39](open-sauced/ai#39)) ([735fa66](open-sauced/ai@735fa66)), closes [#16](open-sauced/ai#16)
## 1.0.0 (2023-05-13) ### π Documentation * README and LICENSE ([917f7b0](open-sauced/ai@917f7b0)) * Updated the README.md ([#15](open-sauced/ai#15)) ([3e4dd69](open-sauced/ai@3e4dd69)) ### π Continuous Integration * automated github releases ([#39](open-sauced/ai#39)) ([735fa66](open-sauced/ai@735fa66)), closes [#16](open-sauced/ai#16) ### π§βπ» Code Refactoring * improved-auth-strategy ([#56](open-sauced/ai#56)) ([d8b27c3](open-sauced/ai@d8b27c3)) ### π Features * add home page and profile page ([#36](open-sauced/ai#36)) ([8a43288](open-sauced/ai@8a43288)) * add to highlights button ([#64](open-sauced/ai#64)) ([e2120a1](open-sauced/ai@e2120a1)) * Added a configuration file ([#32](open-sauced/ai#32)) ([ec6722c](open-sauced/ai@ec6722c)) * Added light mode to GH profile buttons ([#40](open-sauced/ai#40)) ([a7ea43a](open-sauced/ai@a7ea43a)) * Added linting to the project. ([#49](open-sauced/ai#49)) ([1f73007](open-sauced/ai@1f73007)) * Auto PAT authentication ([#29](open-sauced/ai#29)) ([f4f8cf6](open-sauced/ai@f4f8cf6)) * extension window navigation ([#21](open-sauced/ai#21)) ([b5ae9a6](open-sauced/ai@b5ae9a6)) * GitHub page update listener ([#37](open-sauced/ai#37)) ([06b070f](open-sauced/ai@06b070f)) * Invite to OpenSauced ([#20](open-sauced/ai#20)) ([0c8f222](open-sauced/ai@0c8f222)) * PAT authentication ([#27](open-sauced/ai#27)) ([e726a93](open-sauced/ai@e726a93)) * updated the extension logo ([#22](open-sauced/ai#22)) ([d19034d](open-sauced/ai@d19034d)) * view on OpenSauced button ([#14](open-sauced/ai#14)) ([a447551](open-sauced/ai@a447551)) * vote repos ([#70](open-sauced/ai#70)) ([ff2c8f4](open-sauced/ai@ff2c8f4)) ### π Bug Fixes * rename the. extension ([294e499](open-sauced/ai@294e499)) * Update URLs ([5828e20](open-sauced/ai@5828e20)) * attach dist folder to release assets ([#47](open-sauced/ai#47)) ([4f50e72](open-sauced/ai@4f50e72)) * circular-deps in vote buttons ([675496c](open-sauced/ai@675496c)) * Duplicate buttons on GH profile page ([#48](open-sauced/ai#48)) ([9ee2dca](open-sauced/ai@9ee2dca)) * incorrect request for voting ([#72](open-sauced/ai#72)) ([7a35014](open-sauced/ai@7a35014)) * make emails less creepy ([a08fa45](open-sauced/ai@a08fa45)) * re-enable tailwind base class on extension popup ([#31](open-sauced/ai#31)) ([c081217](open-sauced/ai@c081217)) * remove activeTab manifest.json ([#50](open-sauced/ai#50)) ([dd71480](open-sauced/ai@dd71480)) * render emojis in user bio ([#68](open-sauced/ai#68)) ([d0158a5](open-sauced/ai@d0158a5)) * set-output deprecation warning ([#51](open-sauced/ai#51)) ([486f84b](open-sauced/ai@486f84b)) * unrecognized-manifest-key ([#55](open-sauced/ai#55)) ([d622500](open-sauced/ai@d622500)) * Wrapped the await call in an async() ([#26](open-sauced/ai#26)) ([357aab5](open-sauced/ai@357aab5))
What type of PR is this? (check all applicable)
Description
This PR add 2 pages to the extension popup/dropdown.
As written in the commit descriptions, here are the changes I made along with those two pages.
tailwind.config.cjs
. More often than not, tailwind divider would not be centered between elements, we need to specify padding corrections. therefore, I search the internet and found that plugin to simplify the proccess.manifest.json
to check url of current tab from extension popup (this related to previous bullet point)context api
, so it can be used anywhere without prop drillingsetRenderedPage
to accept props, because I need to pass username to profile page, this is another reason why I refactored the routing logic usingcontext api
, so I can pass props tosetRenderedPage
setRenderedPage
withsetCurrentPage
function to make it easy if we want to update route state without passing propscacheFetch
to be able cache data from api, reducing api calls.getUserData
onfetchOpenSaucedApiData.ts
to fetch more detailed user datagetUserPRData
to fetch user PR dataNote:
I use inline styling 'flexWrap' in profile page because when I use tailwind
flex-wrap
class, it's interfering with github page (again). maybe we should use shadow DOM approach?I know another workaround that doesn't involve Shadow DOM, we use 2 different tailwind.config.cjs, and add prefix to tailwind classes used in content-scripts (prefix can be set from
tailwind.config.cjs
), so it doesn't conflict with github page styles anymore.Another note:
I don't use real data for
Avg PR velocity
andContributed Repos
in extension dropdown profile page , I just mimic the UI from Opensauced user dashboard, I don't know where the data came from or how to calculate the data.Suggestion:
Related Tickets & Documents
Fixes #28
Mobile & Desktop Screenshots/Recordings
This add 2 pages to extension popup/dropdown:
home page
@bdougie What do you think about this homepage? Is this the same as what you imagine?
and profile page
If current tab is on github profile page, the profile is opensauced user, then new button/link to show profile will be added to tools section.
and if the button is clicked, it will show the profile page with the profile data
Screen record:
extension-homepage-2023-04-26_13.09.18.mp4
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?