diff --git a/src/entities/row-friends/ui/row-friends.tsx b/src/entities/row-friends/ui/row-friends.tsx index cfc47144..eadf086b 100644 --- a/src/entities/row-friends/ui/row-friends.tsx +++ b/src/entities/row-friends/ui/row-friends.tsx @@ -16,7 +16,7 @@ const RowFriends: FC = ({ avatars }) => { 'mr-[-20px] z-[90]', 'mr-[-20px] z-[80]', 'mr-[-20px] z-[70]', - 'mr-[-0px] z-[60]' + 'mr-[-20px] z-[60]' ] const renderImg = (avatars: string[]): JSX.Element[] => { @@ -33,10 +33,10 @@ const RowFriends: FC = ({ avatars }) => { } return ( -
+
{avatars.length} друзей -
+
{renderImg( avatars.slice(0, avatars.length > maxCount ? maxCount : avatars.length) )} diff --git a/src/pages/page-profile/ui/card-profile-desc.tsx b/src/pages/page-profile/ui/card-profile-desc.tsx new file mode 100644 index 00000000..ddfc4823 --- /dev/null +++ b/src/pages/page-profile/ui/card-profile-desc.tsx @@ -0,0 +1,26 @@ +import { type FC } from 'react' + +import CalenderIcon from './svg/Calendar.svg' +import LoacationIcon from './svg/Location Point.svg' +import UserIcon from './svg/User.svg' +import BankIcon from './svg/bank.svg' + +const desc = [ + { text: 'Москва', icon: LoacationIcon }, + { text: 'Мужской', icon: UserIcon }, + { text: 'overcast', icon: BankIcon }, + { text: '20.05.1995', icon: CalenderIcon } +] + +const CardProfileDesc: FC = () => { + return ( +
+ {desc.map((item, ind) => ( +

+ {item.text} +

+ ))} +
+ ) +} +export { CardProfileDesc } diff --git a/src/pages/page-profile/ui/card-profile-mobile.tsx b/src/pages/page-profile/ui/card-profile-mobile.tsx new file mode 100644 index 00000000..986cb9a0 --- /dev/null +++ b/src/pages/page-profile/ui/card-profile-mobile.tsx @@ -0,0 +1,42 @@ +import { RowFriends } from '@entities/row-friends' +import { Button } from '@shared/ui/button' +import { UserAvatar } from '@shared/ui/user-avatar' +import { type FC } from 'react' +import { CardProfileDesc } from './card-profile-desc' + +import avatarLight from '@assets/avatar/default avatar light.svg' + +const CardProfileMobile: FC = () => { + return ( +
+
+
+ +
+

+ Борис Маслов +

+
+ Я - опытный UX/UI дизайнер с более чем 4-летним стажем работы в этой + области. +
+ +
+
+
+
+
+
+
+ Я - опытный UX/UI дизайнер с более чем 4-летним стажем работы в этой области. +
+ +
+ +
+ ) +} +export { CardProfileMobile } diff --git a/src/pages/page-profile/ui/card-profile.tsx b/src/pages/page-profile/ui/card-profile.tsx new file mode 100644 index 00000000..5893fbea --- /dev/null +++ b/src/pages/page-profile/ui/card-profile.tsx @@ -0,0 +1,33 @@ +import { RowFriends } from '@entities/row-friends' +import { Button } from '@shared/ui/button' +import { UserAvatar } from '@shared/ui/user-avatar' +import { type FC } from 'react' + +import avatarLight from '@assets/avatar/default avatar light.svg' +import { CardProfileDesc } from './card-profile-desc' + +const CardProfile: FC = () => { + return ( +
+
+
+
+ +
+

Борис Маслов

+ +
+
+
+
+
+ +
+ Я - опытный UX/UI дизайнер с более чем 4-летним стажем работы в этой области. +
+
+
+ ) +} +export { CardProfile } diff --git a/src/pages/page-profile/ui/image/image.png b/src/pages/page-profile/ui/image/image.png new file mode 100644 index 00000000..64d6d55e Binary files /dev/null and b/src/pages/page-profile/ui/image/image.png differ diff --git a/src/pages/page-profile/ui/page-profile.tsx b/src/pages/page-profile/ui/page-profile.tsx index fd12f68b..d211712e 100644 --- a/src/pages/page-profile/ui/page-profile.tsx +++ b/src/pages/page-profile/ui/page-profile.tsx @@ -1,17 +1,34 @@ -import { selectUser } from '@app/store/reducers/profileInfo/selectors' -import { useAppSelector } from '@shared/lib/hooks/store-hooks' +import { Banner } from '@shared/ui/banner' +import { InputSendMessage } from '@shared/ui/input-send-message' import { type FC } from 'react' +import { CardProfile } from './card-profile' +import { CardProfileMobile } from './card-profile-mobile' +import { PostNews } from './post-news' -const PageProfile: FC = () => { - const user = useAppSelector(selectUser) +import avatarLight from '@assets/avatar/default avatar light.svg' +const PageProfile: FC = () => { return (
-

- name: {user?.firstName} {user?.lastName} -

-

email: {user?.email}

-

id: {user?.id}

+
+ +
+ + {/* mobile user info */} + + + {}} + placeholder='Что у вас нового?' + className='border-none' + /> + + + + +
+
) } diff --git a/src/pages/page-profile/ui/post-news.tsx b/src/pages/page-profile/ui/post-news.tsx new file mode 100644 index 00000000..18c4109c --- /dev/null +++ b/src/pages/page-profile/ui/post-news.tsx @@ -0,0 +1,79 @@ +import { Button } from '@shared/ui/button' +import { UserAvatar } from '@shared/ui/user-avatar' +import { type FC, type ReactNode } from 'react' + +import icon1 from './svg/icon1.svg' + +import EyeIcon from './svg/Eye.svg' + +import { ButtonAction } from '@shared/ui/button-action' +import { InputSendMessage } from '@shared/ui/input-send-message' +import Image1 from './image/image.png' + +interface IPostNewsProps { + children?: ReactNode + className?: string +} +const PostNews: FC = () => { + return ( +
+
+
+ +
+

Борис Маслов

+

21 окт. в 13:11

+
+
+
+ +
+
+

+ 15 октября прошёл финал онлайн-хакатона VTB API hackathon 2022, я принял в нем + участие, участвовал впервые. Наша команда в составе 3-ёх человек заняла 7 место. + Было 2 задачи: +

+ 1 Создайте продукты на основе API
2 Разработайте инструменты обеспечения + безопасности API
+ Показать полностью +

+
+
+ +
+
+ + +
+
+
+
+ 10 + 10 + 10 +
+
+

+ 1 +

+
+
+
+
+ +
+

Борис Маслов

+

Классное фото

+

+ 21 окт. в 13:11 Ответить +

+
+
+ {}} placeholder='Написать сообщение...' /> +
+ ) +} +export { PostNews } diff --git a/src/pages/page-profile/ui/svg/Calendar.svg b/src/pages/page-profile/ui/svg/Calendar.svg new file mode 100644 index 00000000..4ebf62ee --- /dev/null +++ b/src/pages/page-profile/ui/svg/Calendar.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-profile/ui/svg/Comment.svg b/src/pages/page-profile/ui/svg/Comment.svg new file mode 100644 index 00000000..bf92f219 --- /dev/null +++ b/src/pages/page-profile/ui/svg/Comment.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-profile/ui/svg/Eye.svg b/src/pages/page-profile/ui/svg/Eye.svg new file mode 100644 index 00000000..07a8c020 --- /dev/null +++ b/src/pages/page-profile/ui/svg/Eye.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/page-profile/ui/svg/Like.svg b/src/pages/page-profile/ui/svg/Like.svg new file mode 100644 index 00000000..61f3a70d --- /dev/null +++ b/src/pages/page-profile/ui/svg/Like.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/page-profile/ui/svg/Location Point.svg b/src/pages/page-profile/ui/svg/Location Point.svg new file mode 100644 index 00000000..0beb178a --- /dev/null +++ b/src/pages/page-profile/ui/svg/Location Point.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/page-profile/ui/svg/Send.svg b/src/pages/page-profile/ui/svg/Send.svg new file mode 100644 index 00000000..2055785e --- /dev/null +++ b/src/pages/page-profile/ui/svg/Send.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-profile/ui/svg/Share.svg b/src/pages/page-profile/ui/svg/Share.svg new file mode 100644 index 00000000..414510a9 --- /dev/null +++ b/src/pages/page-profile/ui/svg/Share.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/pages/page-profile/ui/svg/Smile.svg b/src/pages/page-profile/ui/svg/Smile.svg new file mode 100644 index 00000000..4d0fa0b8 --- /dev/null +++ b/src/pages/page-profile/ui/svg/Smile.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/pages/page-profile/ui/svg/User.png b/src/pages/page-profile/ui/svg/User.png new file mode 100644 index 00000000..127aa8ce Binary files /dev/null and b/src/pages/page-profile/ui/svg/User.png differ diff --git a/src/pages/page-profile/ui/svg/User.svg b/src/pages/page-profile/ui/svg/User.svg new file mode 100644 index 00000000..55fd0158 --- /dev/null +++ b/src/pages/page-profile/ui/svg/User.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-profile/ui/svg/bank.svg b/src/pages/page-profile/ui/svg/bank.svg new file mode 100644 index 00000000..857d4878 --- /dev/null +++ b/src/pages/page-profile/ui/svg/bank.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-profile/ui/svg/icon1.svg b/src/pages/page-profile/ui/svg/icon1.svg new file mode 100644 index 00000000..13d7f626 --- /dev/null +++ b/src/pages/page-profile/ui/svg/icon1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/pages/page-profile/ui/svg/paperclip.svg b/src/pages/page-profile/ui/svg/paperclip.svg new file mode 100644 index 00000000..678a567c --- /dev/null +++ b/src/pages/page-profile/ui/svg/paperclip.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/page-registration/ui/page-registration.tsx b/src/pages/page-registration/ui/page-registration.tsx index 01e9eb15..099f6ec1 100644 --- a/src/pages/page-registration/ui/page-registration.tsx +++ b/src/pages/page-registration/ui/page-registration.tsx @@ -12,6 +12,10 @@ import { type FC } from 'react' import { useForm, type SubmitHandler } from 'react-hook-form' import { useNavigate } from 'react-router-dom' +interface IFormInputs extends IRegistrationForm { + confirmPassword: string +} + const PageRegistration: FC = () => { const { toast } = useToast() const dispatch = useAppDispatch() @@ -22,10 +26,17 @@ const PageRegistration: FC = () => { handleSubmit, watch, formState: { errors } - } = useForm({ mode: 'onSubmit' }) + } = useForm({ mode: 'onSubmit' }) + + const onSubmit: SubmitHandler = async (data) => { + const payload: IRegistrationForm = { + firstName: data.firstName, + lastName: data.lastName, + email: data.email, + password: data.password + } - const onSubmit: SubmitHandler = async (data) => { - await dispatch(registrationThunk(data)).then((data) => { + await dispatch(registrationThunk(payload)).then((data) => { if (data.meta.requestStatus === 'fulfilled') { navigate('/') toast({ diff --git a/src/shared/lib/reg-exp.ts b/src/shared/lib/reg-exp.ts index 46fc7c30..4f25de24 100644 --- a/src/shared/lib/reg-exp.ts +++ b/src/shared/lib/reg-exp.ts @@ -1,4 +1,4 @@ export const passwordRegExp = /^[a-zA-Z!@#-_=+$%()/.,`^&*\d]+$/ export const emailRegExp = /^(?=.{1,256}$)[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/ export const usernameRegExp = /^[a-zA-Z0-9_-]+$/ -export const nameRegExp = /^[а-яА-Яa-zA-Z]+$/u +export const nameRegExp = /^[а-яА-ЯёЁa-zA-Z]+$/u diff --git a/src/shared/lib/types/forms.ts b/src/shared/lib/types/forms.ts index 5f36d90b..953e4e5e 100644 --- a/src/shared/lib/types/forms.ts +++ b/src/shared/lib/types/forms.ts @@ -7,7 +7,6 @@ export interface IRegistrationForm { lastName: string email: string password: string - confirmPassword: string } export interface IEditUserInfoForm { username?: 'string' diff --git a/src/shared/ui/banner.tsx b/src/shared/ui/banner.tsx new file mode 100644 index 00000000..d35fe73c --- /dev/null +++ b/src/shared/ui/banner.tsx @@ -0,0 +1,20 @@ +import { cn } from '@shared/lib/merge-classes' +import { type FC } from 'react' + +import banner from '@assets/banner/default user banner.jpg' + +interface IBannerProps { + className?: string +} + +const Banner: FC = ({ className }) => { + return ( + banner + ) +} + +export { Banner } diff --git a/src/shared/ui/dialog.tsx b/src/shared/ui/dialog.tsx index 16b8e67e..8bd8645a 100644 --- a/src/shared/ui/dialog.tsx +++ b/src/shared/ui/dialog.tsx @@ -35,7 +35,7 @@ const DialogContent = React.forwardRef< {

Аккаунт

- banner +