Fix/reducing requests#76
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
anastakozz
left a comment
There was a problem hiding this comment.
I would be happy to finish this review after you fix the problem with getCart in App.tsx that crashes the app. Though, Forms look really nice)
There was a problem hiding this comment.
seems like it's not for committing
| "format": "prettier --log-level warn --write 'src/**/*.{ts,tsx,json}'", | ||
| "win-format": "prettier --log-level warn --write 'find src -type f \\( -name \"*.js\" -o -name \"*.jsx\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.css\" -o -name \"*.md\" -o -name \"*.json\" \\) -exec prettier --write {} \\;'", | ||
| "lint:fix": "eslint --fix src/**/*.{ts,tsx}", | ||
| "format:fix": "prettier --write src/.", |
| import HomePage from './pages/homePage'; | ||
| import ProductsPage from './pages/productsPage'; | ||
| import AboutPage from './pages/aboutPage'; | ||
| import CartPage from './pages/cartPage'; |
There was a problem hiding this comment.
why you prefer not using aliases here?
| import LogoutIcon from '@icons/logoutIcon'; | ||
| import LogoutIconDark from '@icons/logoutIconDark'; | ||
| import { tokenNames } from '@enums'; | ||
| import ProfileIcon from '../../../icons/profileIcon'; |
| } | ||
| }; | ||
| parentCategoryName === openedCategory ? setRotationAngle('90') : setRotationAngle('-90'); | ||
| }, [openedCategory, parentCategoryName]); |
| }) | ||
| .catch(err => { | ||
| console.error(err); | ||
| if (err.response.data.error == 'invalid_customer_account_credentials') { |
There was a problem hiding this comment.
It was implemented the same way previously, but maybe you could improve it slightly and add an error message for any other types of errors, for example "something went wrong"... In case when request fails, there is no error message now and the page looks unfinished
| .catch(err => console.log(err)); | ||
| async function setToken() { | ||
| if (!isLoggedIn && !isSeenBefore) { | ||
| await setAnonymousToken() |
There was a problem hiding this comment.
please check getCart function and add errorHandling. If there is no token in localStorage app crashes
| @@ -0,0 +1,62 @@ | |||
| import { Dropdown } from './Dropdown'; | |||
| import { ControlledInput } from './ControlledInput'; | |||
| import { AddressProps } from '../../../lib/interfaces'; | |||
| import { IControlledInputContainer } from '../../../lib/interfaces'; | ||
| import { ValidFieldNames } from '../../../lib/types'; | ||
| import { HidePassword } from '../../../icons/hidePassword'; | ||
| import { ShowPassword } from '../../../icons/showPassword'; |
| import React, { ChangeEvent, useState } from 'react'; | ||
| import { IControlledInputContainer } from '../../../lib/interfaces'; | ||
| import { ValidFieldNames } from '../../../lib/types'; | ||
| import { HidePassword } from '../../../icons/hidePassword'; |
There was a problem hiding this comment.
Would please change naming for this icons : like HidePasswordIcon or smth. Now it looks like a function, not a component
Product Page:
SignIn and SignUp pages:
Removed the horror that was, replaced it with useForm and Yup.