From 86f92597d2a527346f51d9e5d74e5ef393b2297c Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Wed, 6 Dec 2023 17:08:17 +0100 Subject: [PATCH 1/5] redirect to edit profile --- .../ProfileDetail/MainInfo/TitleInfo.jsx | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx index 7787294b2..84487aa8a 100644 --- a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx +++ b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx @@ -1,4 +1,5 @@ import { useState, useMemo } from 'react'; +import { useNavigate } from 'react-router-dom'; import { Badge } from 'antd'; import { StarOutlined, StarFilled } from '@ant-design/icons'; import { PropTypes } from 'prop-types'; @@ -10,6 +11,7 @@ import classes from './TitleInfo.module.css'; function TitleInfo({ isAuthorized, data }) { const { user } = useUser(); + const navigate = useNavigate(); const [isSaved, setIsSaved] = useState(data.is_saved); const profile = useMemo(() => { return { @@ -72,6 +74,10 @@ function TitleInfo({ isAuthorized, data }) { } }; + const navigateToEditProfile = () => { + navigate('/profile/user-info'); + }; + const filledStar = (
{profile.region}
- {isAuthorized && !ownProfile ? ( - + {isAuthorized ? ( + <> + {!ownProfile && ( + + )} + {ownProfile && ( + + )} + ) : null} ); From 0a8bb19e2b5079d0f41be03d1cc0b43cf8f042c8 Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Thu, 7 Dec 2023 23:34:44 +0100 Subject: [PATCH 2/5] classnames added --- FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx index 84487aa8a..d9f8b499e 100644 --- a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx +++ b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx @@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'; import { Badge } from 'antd'; import { StarOutlined, StarFilled } from '@ant-design/icons'; import { PropTypes } from 'prop-types'; +import classNames from 'classnames'; import useSWRMutation from 'swr/mutation'; import { useUser } from '../../../hooks'; @@ -145,9 +146,9 @@ function TitleInfo({ isAuthorized, data }) { )} {ownProfile && ( From 7eb5b4549fbe07603f48993955fad5b033c67713 Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Fri, 8 Dec 2023 12:31:57 +0100 Subject: [PATCH 4/5] button -> a, styles fixed --- .../components/ProfileDetail/MainInfo/TitleInfo.jsx | 8 ++++---- .../ProfileDetail/MainInfo/TitleInfo.module.css | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx index a3771fc0b..1b48ba93d 100644 --- a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx +++ b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx @@ -162,13 +162,13 @@ function TitleInfo({ isAuthorized, data }) { )} {ownProfile && ( - + )} ) : null} diff --git a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.module.css b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.module.css index 47588be6a..43830cfde 100644 --- a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.module.css +++ b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.module.css @@ -1,6 +1,6 @@ .title-block { display: flex; - width: 1304px; + width: 1280px; padding: 16px 12px 8px 12px; align-items: flex-start; gap: 12px; @@ -26,10 +26,9 @@ .title-block__about { display: flex; - width: 1010px; flex-direction: column; align-items: flex-start; - flex-shrink: 0; + flex: 1 0 0; } .title-block__activity { @@ -77,7 +76,7 @@ .title-block__button { display: flex; - height: 34px; + height: 32px; padding: 5px 15px; justify-content: center; align-items: center; @@ -88,6 +87,10 @@ cursor: pointer; } +.title-block__link { + height: 22px; +} + .added_to_saved__button { background: var(--primary-green-80, #1F9A7C); } From a4e4b93729482b4cbab6bcc6385e2dbe872baced Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Sun, 10 Dec 2023 21:29:50 +0100 Subject: [PATCH 5/5] return null removed --- FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx index 1b48ba93d..ce338693b 100644 --- a/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx +++ b/FrontEnd/src/components/ProfileDetail/MainInfo/TitleInfo.jsx @@ -96,7 +96,6 @@ function TitleInfo({ isAuthorized, data }) { if (isAuthorized) { return isSaved ? filledStar : outlinedStar; } - return null; }; const CategoryBadges = ({ categories }) => {