Skip to content

refactor: login, register pages#18

Closed
Pikaz0r922 wants to merge 1 commit intodevfrom
refactor-TAS-26
Closed

refactor: login, register pages#18
Pikaz0r922 wants to merge 1 commit intodevfrom
refactor-TAS-26

Conversation

@Pikaz0r922
Copy link
Copy Markdown

No description provided.

Comment thread apps/frontend/src/pages/login/ui/LoginForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/login/ui/LoginForm.tsx Outdated
Comment thread apps/frontend/src/shared/ui/index.ts Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterPage.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/register/ui/RegisterForm.tsx Outdated
Comment thread apps/frontend/src/pages/login/ui/LoginPage.tsx
Comment thread apps/frontend/src/pages/login/ui/LoginForm.tsx
Comment thread apps/frontend/src/pages/login/ui/LoginPage.tsx Outdated
Comment thread apps/frontend/src/pages/login/ui/LoginPage.tsx Outdated
@Pikaz0r922 Pikaz0r922 force-pushed the refactor-TAS-26 branch 3 times, most recently from c720d0f to 35f4abf Compare April 1, 2026 15:45
return (
<>
<div className="bg-gray-100 rounded-lg h-64 flex items-center justify-center text-gray-400 mt-8">
Скриншот интерфейса
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

скриншота тут быть не должно, не обратил внимания что написал комент на весь блок. Соответственно компонент нужно переименовать по смыслу

@@ -0,0 +1,12 @@
'use client';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Типизация. Пропсы и возвращаемое значение

@@ -0,0 +1,12 @@
'use client';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Компонент может работать как серверный

<div className="bg-gray-100 rounded-lg h-64 flex items-center justify-center text-gray-400 mt-8">
Скриншот интерфейса
</div>
<p className="text-gray-500 text-sm mt-4">© {new Date().getFullYear()} TaskTracker Lab.</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text-muted-foreground. mt-4 не нужен


import { Button, InputGroup, InputGroupAddon, InputGroupInput } from 'shared/ui';
import { useState } from 'react';
export function PasswordInput(props: React.InputHTMLAttributes<HTMLInputElement>) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. нужен более "тупой" компонент. Это будет компонент который меняет иконку по пропсу, всё остальное верни где было.
  2. Пустая строка между компонентом и импортами
  3. Переименуй по компонент по смыслу

@@ -0,0 +1,20 @@
'use client';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

будет серверный


export function AppLogo() {
return (
<div className="flex items-center mb-20 gap-3">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

никаких mb. почитай про схлопывание марджинов

import Image from 'next/image';
import { LogoImage } from 'shared/assets';

export function AppLogo() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

типизация. пропсы и возвращаемое значение

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно добавить возможность выбора варианта логотипа и размера. Точно так же как это сделано в shared/ui/button

return (
<div className="flex items-center mb-20 gap-3">
<Image src={LogoImage} alt="logo" />
<h1 className="text-2xl font-bold">TaskTracker Lab</h1>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это не h1

<div className="hidden md:flex flex-col justify-between bg-secondary p-10 w-1/2">
<div>
<AppLogo />
<div className="mb-4">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше вместо mb-4 задать mt-4 ScreenshotPlaceholder

</div>
<RegisterForm />
<div className="flex gap-3 justify-center text-sm">
<p className="text-muted-foreground mb-6">уже есть аккаунт?</p>
Copy link
Copy Markdown
Contributor

@kapitulin24 kapitulin24 Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вместо mb-6 для блока div pb-6

}

@theme {
--color-link: oklch(54.6% 0.245 262.881);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

странная строчка. нужно --color-link: var(--link); и выше в @theme inline

body {
@apply bg-background text-foreground;
}
button:not(:disabled),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это в shared/ui/button нужно

return (
<form className="space-y-6 mb-4" onSubmit={handleSubmit(onSubmit)}>
<div className="flex flex-col space-y-4">
<form className="space-y-6 mb-6" onSubmit={handleSubmit(onSubmit)}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb-6 не нужен, этот отступ лучше задать другим способом в пэйдже

{errors.email && (
<FieldDescription className="text-red-500">{errors.email.message}</FieldDescription>
)}
{errors.email && <FieldError className="text-red-500">{errors.email.message}</FieldError>}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем тут кастомный text-red?

<FieldDescription className="text-red-500 text-sm">
{errors.password.message}
</FieldDescription>
<FieldError className="text-red-500 text-sm">{errors.password.message}</FieldError>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем тут кастомный text-red? еще и размер текста

<FieldError className="text-red-500 text-sm">{errors.password.message}</FieldError>
)}
</Field>
<div className="flex items-center justify-between text-sm">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label все равно переопределяет размер текста. если он нужен, то тогда нужно его только для link задать

</Link>
</Label>
{errors.terms && (
<FieldError className="text-red-500 text-xs ml-6">{errors.terms.message}</FieldError>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

уже писал про стили

)}
/>
Я согласен с
<Link href="/auth/reset-password" className="text-link hover:underline">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно создать Link в shared/ui с нужными стилями

</Field>
<div className="flex items-center justify-between text-sm">
<Label className="flex items-center gap-2">
<Checkbox />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужен в схеме и контролируемый ввод

<Checkbox />
Запомнить меня
</Label>
<Link href="/auth/reset-password" className="text-link hover:underline">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

про линк где-то в регистрации писал уже

@@ -1,19 +1,34 @@
'use client';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

должен работать как серверный, вроде ничего не мешает

Copy link
Copy Markdown
Contributor

@kapitulin24 kapitulin24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в папке shared/ui пишем в кебаб-кейс как уже заведено в shadcn дабы каждый компонент не переименовывать при добавлении. Все остальное в кэмел кейс.
ошибки в регистрации аналогичны логину и наоборот, так что всё не писал

@kapitulin24 kapitulin24 closed this Apr 7, 2026
@kapitulin24 kapitulin24 deleted the refactor-TAS-26 branch April 7, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants