-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/reducing requests #76
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yessss
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliases?
} | ||
}; | ||
parentCategoryName === openedCategory ? setRotationAngle('90') : setRotationAngle('-90'); | ||
}, [openedCategory, parentCategoryName]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice)
}) | ||
.catch(err => { | ||
console.error(err); | ||
if (err.response.data.error == 'invalid_customer_account_credentials') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliases
import { IControlledInputContainer } from '../../../lib/interfaces'; | ||
import { ValidFieldNames } from '../../../lib/types'; | ||
import { HidePassword } from '../../../icons/hidePassword'; | ||
import { ShowPassword } from '../../../icons/showPassword'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliases)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.