-
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
Pull request for review 2 #76
base: main
Are you sure you want to change the base?
Conversation
getUserInformation() | ||
.then((user) => { | ||
setIsLoggedIn(true); | ||
if (user.role === 'volunteer') { |
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.
Лучше в таких случаях использовать switch case, а не if
first_name: '', | ||
second_name: '', | ||
last_name: '', | ||
const [currentUser, setCurrentUser] = useState({ |
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.
Не думали завести централизованное хранилище Redux или Mobx?
Promise.all([getNews(), getPlatformAbout()]) | ||
.then(([dataNews, dataPlatformAbout]) => { | ||
setNews(dataNews.results); | ||
const { about_us: aboutUs, valuations } = dataPlatformAbout; |
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.
Существует такой паттерн программирования называется адаптер, вот чтобы не деструктурировать с переименованием. Можете его применить кога вас не удовлетворяют поля которые приходят с сервера https://doka.guide/js/design-patterns-structural/
closeModal(); | ||
logOut() | ||
.then(() => { | ||
localStorage.removeItem('token'); |
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.
Вынесите работу с localStorage в отдельные функции, где ключ вы будете передавать как аргумент.
|
||
const router = createBrowserRouter([ | ||
const router = createHashRouter([ |
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.
Почему используете hash router? Если хотите публиковать на githubPages можете завести переменную окружения и если деплой идет на github pages то подставлять hashrouter, а вообще лучше использовать brouserRouter
}} | ||
/> | ||
<Footer platformEmail={platformEmail} /> | ||
<Modal modal={modal} closeModal={closeModal} /> | ||
{modal.isOpen && | ||
createPortal( |
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.
Портал нужно создать внутри самого компонента модального окна, т.е. обернуть его в createPortal, чтобы каждый раз не подключать его
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.
Работа в целом написана хорошо, лучше конечно завести централизованное хранилище, т.к. данные размазаны по всему проекту и следить за ними и контролировать становится все сложнее. В качестве хранилища используйте либо Mobx, либо Redux Toolkit
…ject-view Feature/project view
feat(projectview): changed row gap
…t-project Feature/edit project
…changed font size
Added presentation link
…style Fix/slider style
…name fix(request): change domain name
fix: changing domain, readme
build(restarting the build): restart
refactor: readme
readme, fix build
В данном Pull request находится актуальное состояние ветки Develop.