Skip to content

Removed unused import statement#217

Open
tylerwelsh wants to merge 65 commits intobradtraversy:masterfrom
Brian-Pob:tyler
Open

Removed unused import statement#217
tylerwelsh wants to merge 65 commits intobradtraversy:masterfrom
Brian-Pob:tyler

Conversation

@tylerwelsh
Copy link

This was the first code smell I resolved.

hollyxj and others added 30 commits April 5, 2023 14:25
Code smell #1 for me is fixed.
The "return" is not needed.
Removed unnecessary return statement
Product carousel - Extract this nested ternary operation into an inde…
OrderScreen.js - Extract nested ternary operation to if-statements
HomeScreen.js - Extract this nested ternary operation into if statements
working on ordrescreen.js smells
Rating.js - Extract all nested ternary operations into Stars class
made the key variable unique to the item instead of the list index. This is because list indexes change and would make the key variable unsafe.
I made the html "key" variable unique to the item instead of the list index that we are looping through. This is because list index could change. Instead, we used the "item.name" since each item has a unique "name" to identify it.
This code smell was changed for better readability. What is happening is if text is truthful (meaning it is not null, undefined, 0, etc) then we render what the text prop actually is. Using the ternary operator we are able to read it much better as "If text is true and not null, then render text, otherwise, render nothing."
Using the latter "\d" is is not only shorter in terms of expression length, but also easier to read and thus to maintain. I replaced the bulky "[0-9]" with a more concise equivalent "\d"
tylerwelsh and others added 30 commits April 24, 2023 20:09
Added the "save for later" feature to the project. For phase 2 it is required to be at least 30% completed. So far, I have done a lot of it, for phase 3 I need to implement adding it to the cart from the save for later page.
…Model.js, and contactController.js. The frontend is working but the email is not sending, need to troubleshoot further.
… have to update the email functionality so it actually sends the email. Before it was not ever getting to the point where it said email sent, it would just say something went wrong.
…created/modified files. Removed unused imports across all created/modified files. Renamed \“contactReducer.js\” to \“contactReducers.js\” to match the established format of the names of the reducer files in the code base. (The reducer file names are all plural)
Changes look good. Tested on my machine and it works!
started implementing social login with auth0
Can move an item from the "saved for later" list to the "cart"
Fixed a bug where when the user logs out and logs back in with a DIFFERENT account, the same items in the "save for later" list were still there. Added to the userActions.js file to remove the later items list from the user's local storage when they log out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants