-
Notifications
You must be signed in to change notification settings - Fork 15
Добавлена страница профиля #79
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
base: main
Are you sure you want to change the base?
Conversation
export default function Profile() { | ||
const { user, subscription, loginHistory } = usePage<PageProps>().props; | ||
|
||
const [currentPassword, setCurrentPassword] = 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.
Используется ли React hook form
?
Запланированный стек проекта
Inertia.post('/Logout'); | ||
}; | ||
return ( | ||
<div className="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.
Используется ли shadcn/ui с Tailwind СSS
?
Добавь, пожалуйста, скриншот в описании PR, как выглядит компонент и страница с компонентом.
}; | ||
return ( | ||
<div className="profile-page"> | ||
<Head title={`Профиль ${user.name}`} /> |
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.
Еще предлагаю вынести визуально Head
из контейнера
<>
<Head title={`Профиль ${user.name}`} />
<div className="profile-page">
<h1>Профиль</h1>
<p>
<strong>ID:</strong>
{user.id}
</p>
<p>
... // остальная часть компонента
</>
Понятно, что инерция его разместит в нужном месте, но так он будет более заметным и это подсказывает, что элемент не относится к компоненту
import React, { useState } from 'react'; | ||
import { Head, usePage, Inertia } from '@inertiajs/react'; | ||
|
||
interface 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.
Очень много интерфейсов в компоненте.
В целом, интерфейсы удобнее располагать в файлах types
, согласно иерархии
Проект упорядочиваем к использованию структуры FSD (документация)
Пример возможного размещения
src/pages/profile/
├─ ui/
│ └─ ProfilePage.tsx - здесь компонент
├─ model/
│ └─ profilePageModel.ts - когда требуется модель
| └─ types.ts - сейчас можно интерфейсы убрать в этот файл
└─ index.ts - здесь импорт ирендер компонента
Реализовано: