nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
11.72k stars 1.02k forks source link

Converted NavButtons component into TypeScript #1594

Closed sicin closed 2 months ago

sicin commented 2 months ago

Changed the NavButtons component into TypeScript. Index is apparently not a valid prop of History, altough it obviously exists on the object, that's why the 'as' keyword was used.

nuki-chan[bot] commented 2 months ago

Lines 1-47 in deleted index.js

Oh dear, someone's been coding like it's still 2015. 😆 I see we're throwing out the old class components to make room for those shiny, new functional components with hooks. Goodbye constructor, bind, and opaque this references! Sayonara!

But wait! Before we sail into the sunset with our enlightened code, Nuki noticed a couple of nitty-gritty details. The links here use href='#' which can cause the page to jump to the top when clicked. That’s no good, we don't want to give our users a mini heart attack every time they try to navigate, ne?

Lines 1-35 in new index.tsx

Oh look, kawaii functional components in their natural habitat. 🌸 React hooks are spreading their wings longer than Nuki's last anime binge.

Make these changes if you feel like making Nuki proud! 😸 Remember, code reviews are like group projects; everyone has to play nice with each other, but Nuki's advice is not the be-all and end-all. Keep growing, senpai!


By the way, a shiny ✨ new PR walked into the dojo without a trace of tests. We wouldn't want our fresh code to catch a cold or, Kami forbid, a bug 🐛! So don't forget your tests, dear developer!

Now go forth and refactor! (ノ◕ヮ◕)ノ*:・゚✧

sicin commented 2 months ago

After some thinking I've realized that Nuki-chan is right. PR fixed.

nukeop commented 2 months ago

Thanks, this looks pretty good. In the future instead of force pushing there's nothing wrong with just committing over your original work so we can see what happened at each step.