This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I'm from the Discord
Reactiflux
channel.First of all, I want to say, this project is awesome. I was feeling like I was using a well-made PC application.
Design and animation are remarkable.
I made some changes and it won't affect the behaviors of the app.
Since we don't have tests, I think you need to review by yourself.
I am going to share why I made these changes and some ideas.
removed unnecessary brackets for string to clarify that it is pure string
If a value doesn't include brackets, you can know it is a pure string at first glance.
removed spacebar at the start and the end of classnames.
I'm not sure if it is a typo or has a purpose. If it has a purpose like some js code changes className and assumes these have a space in className.
removed unnecessary async keywords
In this case, you don't need to use
async
. By removing theasync
keyword, you can know that the function doesn't include the logic that needs theasync
keyword.removed unnecessary wrap functions in event handlers
In this case, you can just attach the
handleAddProject
function toonClick
unless the function uses arguments.removed unnecessary type conversion.
fixed timeout releasing logic in DeploymentBar.
A return function of the
setTimeout
function isn't used to release it.used a function to prevent to write the same logic in Header
Since the three functions has the same logic, I removed the duplicate code by defining a function.
relased timeouts when it's unmounted in ModeButtons
It doesn't clear timeout ids, so I added the release logic and stored ids in a ref.
improved rendering bullets logic in StorySection
since they had the same logic, I removed the duplicate code by storing values in a state. I didn't make a change for refs.
Refactoring ideas
Define functions with proper types to store and retrieve values from
localStorage
.It cannot guarantee data consistency. It may cause wrong data insertion.
I think you can ensure the types like this way, it's just an example for references.
Used boolean variables for conditions
In my point of view, it might be better to define a boolean variable with meaningful names.
maybe like this
Define functions to reduce the code duplication
I have found some code is used over several components. By defining functions and calling them, you might reduce some code duplication.
Use
axios
andreact-query
.when it comes to API calls, the same logic is repeated. Like adding a token, converting data to json, adding a header
Content-Type
, and something like that. You can reduce some code by using instances and interceptors inaxios
. If you usereact-query
, you can also take benefits of it such as error handling, and caching.This is it. These are based on my experience, changes can seem not right.
I have learned a lot from your project. I never tried to create this kind of a big project.
I'm really impressed by your skills, commitment, and more.
I literally got motivated. I am thinking about starting my project too.
Anyway, thank you for your time and I will be looking forward to your opinions as well.
Have a nice day!