Release 0.3 Internal PR

    One of the Pull Request for Release 0.3 was to work on an Issue for Telescope, knowing that I had already done an issue on Telescope during Release 0.2, I was happy to make another contribution to the project. This time, I decided to work on the notification favicon.

    At first, I thought it was just a simple task of creating a version of the favicon with a red dot on the top right corner and then changing the favicon from a component, but it was a lot more than I bargained for. There are several things that need to be done in order to get this feature working, the state of the current window's visibility must be determined first in order to execute the hook that changes the favicon. Once that is done, you will have to obtain the id value of the previous app page's top post and compare it to the current state's top post's id. When all the conditions are met, the favicon of the website should switch to the badged version until the window is visible again.

    All this work could not have been done by me alone for I had never learned about React Hooks as well as it's States, Professor Humphrey was kind enough to help me throughout the entirety of this Issue. He provided me with the Hook that allows the favicon to be changed when the app's visibility is false, as well as SWR options to handle unfocused data refresh.

    Before help was received I was convinced that the SEO component, where they render the head elements will be where I put my code, for that was the only method for changing the favicon that I know of at the time. I was basically on a wild goose chase until I received help from the professor, now I know you can access the favicon using hooks and all that had to be done was locate the functions inside the component that renders the post, and access the data.
    



    In this Pull Request I learned tons of things that I had never touched before, things like editing SVG files, React Hooks, React State, etc. I really appreciate David's guidance on this topic, this makes me want to get into more repositories with issues that handle the above subjects.

Comments

Popular posts from this blog

Lab 2 Blog

Lab 4 Blog

Release 0.4