-
Notifications
You must be signed in to change notification settings - Fork 2
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
[SOK-22] User profile page #13
Conversation
Общие доработки: - Верстка шапки - Компонент заголовка - Перенос лайоутов в отдельные папки - PublicLayout - Добавил систему гридов - Доработки базовых стилей
Сам лайоут написал внутри страницы.
с подложкой переименовал в СustomPageTitle - Добавил tag main в компонент PublicLayout
…to SOK-22_user_profile_page
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.
Привет! Классно придумал как сделать редактирование информации о пользователе 👍
У меня много правок по верстке и есть предложение добавить компонент для уведомлений пользователя. Я сейчас накидаю дизайн, если ты занят могу сам компонент сверстать, ты просто к себе затянешь.
Комментов много, если что пиши в тг.
alt?: string | ||
} | ||
|
||
export const Image = (props: ImageProps) => { |
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.
Честно говоря, не понимаю зачем нужен этот компонент, выглядит как будто проще написать img
import { Image } from '@/components/ui/Image/Image' | ||
import { Button } from '@/components/ui/Button/Button' | ||
|
||
export const AVATAR_SRC = 'https://ya-praktikum.tech/api/v2/resources' |
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.
Эту константу стоит вынести в env файл, обсуди с Георгием.
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.
Перенёс
src: string | ||
containerClassName?: string | ||
imageClassName?: string | ||
onAvatarChange: (file: File) => void |
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.
В этом компоненте ничего больше нельзя поменять, я думаю проще переименовать onAvatarChange > onChange
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.
Поправил
<div | ||
className={`${containerClassName}`} | ||
onMouseEnter={() => setIsHovered(true)} | ||
onMouseLeave={() => setIsHovered(false)}> |
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.
Кажется ты чуть-чуть усложнил)) Как по мне проще сделать так:
.avatar-editor {
&::hover {
.avatar-editor__overlay {
display: block;
}
}
}
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.
Есть такое)
Исправил
flex-direction: column; | ||
width: 90%; | ||
max-width: 400px; | ||
margin: 0 auto; |
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.
Перед кнопками нужен отступ, как в макете
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.
Поправил
} | ||
|
||
&__edit-button { | ||
margin-bottom: 2rem; |
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.
Тут отступ больше чем в макете
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.
Поправил
&__change-password { | ||
display: flex; | ||
flex-direction: column; | ||
margin-bottom: 2rem; |
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.
Тут тоже отступ виликоват
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.
Поправил
} | ||
} | ||
|
||
button { |
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.
Я что-то не нашел этот элемент на странице
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.
Исправил
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.
По верстке у тебя получилась большая, сложная вложенность, плюс можно использовать систему гридов из проекта, да и в целом уменьшить количество кода. Я накидаю вариант, закреплю в этом сообщении.
Profile.tsx.zip
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.
Есть крутые решения над которыми задумался
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.
Попробовал, работает с апи яндекса, отображение симпотичное!
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.
Получилось отлично!
Единственное, нужно ограничить ширину инпута, при редактировании информации на странице профиля)
border-radius: 20px; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
transition: background-color 0.3s ease; | ||
|
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.
Мне кажется, что такие цвета лучше вынести в константы
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const file = event.target.files?.[0] | ||
if (file) { | ||
const fileUrl = URL.createObjectURL(file) |
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.
Логику с генерацией url я бы вынес в отдельный хук
@@ -34,19 +34,18 @@ export default function PrivateLayout() { | |||
}, []) | |||
|
|||
// useEffect(() => { | |||
// console.log(user) | |||
// console.log(user) | |||
// }, [user]) |
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.
Лишние комментарии стоит убрать
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.
Отличная работа! Хорошая верстка страниц для пользователя. Понравилось, что вы выделяете Интпуты в отдельные компоненты. В целом, хорошо организована логика в компонентах. Так что ваша работа принята! Желаю успехов в дальнейшем обучении!
### Какую задачу решаем
Скриншоты/видяшка (если есть)
TBD (если есть)