From f02b25e8f3f8fb3a0313cbf86fb7b00da3c0bb44 Mon Sep 17 00:00:00 2001 From: SlimusMinus Date: Mon, 17 Aug 2026 23:17:30 +0300 Subject: [PATCH] change design --- src/components/AuthModal.jsx | 8 +- src/components/RightSidebar.jsx | 87 +++++- src/components/Sidebar.jsx | 85 ++++-- src/components/chat/ChatInputBar.jsx | 4 +- src/components/feed/FeedTopBar.jsx | 24 +- src/components/icons/NavIcons.jsx | 7 + src/components/layout/AppTopBar.jsx | 14 +- src/config/feedConstants.js | 9 +- src/context/ThemeContext.jsx | 4 +- src/locales/en.json | 24 +- src/locales/ru.json | 24 +- src/pages/MainFeed.jsx | 84 ++++-- src/pages/PostOnFeed.jsx | 259 ++++++++++-------- src/pages/ReviewsPage.jsx | 3 + src/styles/NakhodkaLanding.css | 84 +++--- src/styles/base.css | 74 +++--- src/styles/card.css | 380 ++++++++++++++------------- src/styles/chat.css | 142 +++++----- src/styles/layout.css | 206 ++++++++++----- src/styles/modal.css | 40 ++- src/styles/reviews.css | 60 +++-- src/styles/rules.css | 20 +- src/styles/sidebar.css | 244 ++++++++++++----- src/styles/ui.css | 112 +++----- 24 files changed, 1199 insertions(+), 799 deletions(-) diff --git a/src/components/AuthModal.jsx b/src/components/AuthModal.jsx index 39288a8..cecb76f 100644 --- a/src/components/AuthModal.jsx +++ b/src/components/AuthModal.jsx @@ -98,10 +98,10 @@ function LoginFormInline({ saveAuth, onClose, onSwitch }) { -

+

{t('auth.noAccount')}{" "} @@ -216,10 +216,10 @@ function RegisterFormInline({ saveAuth, onClose, onSwitch }) { -

+

{t('auth.hasAccount')}{" "}

diff --git a/src/components/RightSidebar.jsx b/src/components/RightSidebar.jsx index 8a2edb7..0717496 100644 --- a/src/components/RightSidebar.jsx +++ b/src/components/RightSidebar.jsx @@ -1,14 +1,89 @@ +import { useState } from "react"; import { useTranslation } from 'react-i18next'; +import ProfileAvatar from "./profile/ProfileAvatar"; -export default function RightSidebar() { +function FollowButton() { + const [following, setFollowing] = useState(false); const { t } = useTranslation(); + return ( + + ); +} + +export default function RightSidebar({ ads, profileData, isAuthenticated, onProfileClick, onLoginClick, onNavClick }) { + const { t } = useTranslation(); + + const suggestions = [...(ads || [])] + .sort((a, b) => (b.likeCount || 0) - (a.likeCount || 0)) + .slice(0, 4); + + const profileName = isAuthenticated + ? `${profileData?.firstName || ""} ${profileData?.lastName || ""}`.trim() || profileData?.login + : null; + return (
-
{t('rightSidebar.advertisement')}
-
-
📢
-
- +
+ {isAuthenticated ? ( + <> + +
+
{profileName}
+
{profileData?.login}
+
+ + + ) : ( + <> +
+
👤
+
+
+
{t('rightSidebar.guest')}
+
{t('rightSidebar.guestSub')}
+
+ + + )} +
+ +
+ {t('rightSidebar.suggestions')} + +
+ + {suggestions.length === 0 && ( +
{t('rightSidebar.empty')}
+ )} + + {suggestions.map(ad => ( +
+
+
{ad.emoji || "📋"}
+
+
+
{ad.title}
+
+ {ad.city || (ad.type === "loss" ? t('postCard.loss') : t('postCard.found'))} +
+
+ +
+ ))} + +
+ © {new Date().getFullYear()} {t('app.name')} + {t('rightSidebar.footRules')} + {t('rightSidebar.footPrivacy')} + {t('rightSidebar.footSupport')}
); diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index a205615..2c234ce 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -11,6 +11,7 @@ import { useUnread } from "../context/UnreadContext"; import { useLanguageToggle } from "../hooks/useLanguageToggle"; import { useTranslation } from 'react-i18next'; import SupportModal from "./SupportModal"; +import ProfileAvatar from "./profile/ProfileAvatar"; export default function Sidebar({ open, @@ -21,6 +22,9 @@ export default function Sidebar({ onLoginClick, onRulesClick, onReviewsClick, + onCreatePost, + onProfileClick, + profileData, }) { const navigate = useNavigate(); const { theme, toggle: toggleTheme } = useTheme(); @@ -28,6 +32,35 @@ export default function Sidebar({ const { t } = useTranslation(); const { language, toggleLanguage } = useLanguageToggle(); const [supportOpen, setSupportOpen] = useState(false); + const HelpIcon = NavIcons.help; + + const handleNavItem = (itemKey) => { + if (!isAuthenticated && itemKey === "myads") { + onLoginClick(); + return; + } + if (itemKey === "chat") { + if (!isAuthenticated) { + onLoginClick(); + } else { + navigate("/chats"); + } + return; + } + if (itemKey === "create") { + onCreatePost?.(); + return; + } + onNavClick(itemKey); + }; + + const handleProfileClick = () => { + if (!isAuthenticated) { + onLoginClick(); + } else { + onProfileClick?.(); + } + }; return ( <> @@ -40,27 +73,15 @@ export default function Sidebar({