My PR for release 0.3 External Project

 Picking the issue

I am so glad to hear that we are allowed to work on repositories that we have already worked on in the past. That means we don't need to spend time on set it up and learn the code. I decide to work on issue-collab since I am so familiar with the repository. Different than any other issue I have work on, I filed the new issue-76 myself and tried to create a pull request for it. The issue I filed is that add a scroll to the top button. I am trying to add the scroll to the top button into this issue-collab repository just like the one in Telescope. The owner of Issue-collab thinks this is a good idea too.

Working on the issue

The first time when I tried to work on it, I just tried to study the code from Telescope and some from google and playing the code around. I was so annoying that I can't put some code together successfully in React. After watched some React video, I realized that there are two different components which are Class components and Functional Components. their syntax and methods are different too.

Firstly, I come up with a Class components version first in commit 289bdf9. Then I changed it to a functional component(commit 8af5a9) because all the other components in the component folder are functional. I also got stuck by changing it from Class component to Functional component. After studied React Hook API, I solved them by using lifecycle methods useState() and useEffect(). Finally, I end up with a functional component of the scroll to the top button, and it looks shorter and cleaner than Class one.

Sending the pull request

I sent a pull request after I finished the functional component version of the scroll to the top button with a gif.



After the owner of the repo reviewed my pull request, he pointed out that the scrolltotop button will overlap with Next button on the smaller screen. To solve the problem, I added a media query that moves the button in a higher position on the smaller screen.  I also fixed some styling and Name according to the owner's request. 


Links:

repo Issue-collab: https://github.com/trybick/issue-collab

Issue : https://github.com/trybick/issue-collab/issues/76

pull Request: https://github.com/trybick/issue-collab/pulls

Comments

Popular posts from this blog

OSD600 Lab8

OSD600 -- Release 0.4.1 -- Choose Project and issues