added reviews

This commit is contained in:
SlimusMinus
2026-06-23 00:08:15 +03:00
parent d1c907c4c8
commit 35a43e7be4
5 changed files with 17 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import RegisterPage from './components/Authentication';
import MainFeed from './components/MainFeed'; import MainFeed from './components/MainFeed';
import ChatPage from './components/ChatPage'; import ChatPage from './components/ChatPage';
import ChatListPage from './components/ChatListPage'; import ChatListPage from './components/ChatListPage';
import ReviewsPage from './components/ReviewsPage';
import './styles/chat.css'; import './styles/chat.css';
function App() { function App() {
@@ -15,6 +16,7 @@ function App() {
<Route path="/register" element={<RegisterPage />} /> <Route path="/register" element={<RegisterPage />} />
<Route path="/feed" element={<MainFeed />} /> <Route path="/feed" element={<MainFeed />} />
<Route path="/reviews" element={<ReviewsPage />} />
<Route path="/chats" element={<ChatListPage />} /> <Route path="/chats" element={<ChatListPage />} />
<Route path="/chats/:chatId" element={<ChatPage />} /> <Route path="/chats/:chatId" element={<ChatPage />} />
</Routes> </Routes>

View File

@@ -1,4 +1,5 @@
import { useState, useEffect, useCallback, useMemo } from "react"; import { useState, useEffect, useCallback, useMemo } from "react";
import { useNavigate } from "react-router-dom";
import "../styles/index.css"; import "../styles/index.css";
import { API_URL } from "../config/authConstants"; import { API_URL } from "../config/authConstants";
import Sidebar from "./Sidebar"; import Sidebar from "./Sidebar";
@@ -17,6 +18,7 @@ import { useAuthContext } from "../context/AuthContext";
* остальные компоненты получают данные через пропсы. * остальные компоненты получают данные через пропсы.
*/ */
export default function MainFeed() { export default function MainFeed() {
const navigate = useNavigate();
const { user, token, isAuthenticated, logout } = useAuthContext(); const { user, token, isAuthenticated, logout } = useAuthContext();
// Открыт ли левый сайдбар (мобильный слайд-аут) // Открыт ли левый сайдбар (мобильный слайд-аут)
@@ -269,6 +271,7 @@ export default function MainFeed() {
onLogout={logout} onLogout={logout}
onLoginClick={() => setAuthModalOpen(true)} onLoginClick={() => setAuthModalOpen(true)}
onRulesClick={() => setRulesModalOpen(true)} onRulesClick={() => setRulesModalOpen(true)}
onReviewsClick={() => navigate("/reviews")}
/> />
<div className="f-main"> <div className="f-main">

View File

@@ -15,6 +15,7 @@ export default function Sidebar({
onLogout, onLogout,
onLoginClick, onLoginClick,
onRulesClick, onRulesClick,
onReviewsClick,
}) { }) {
const navigate = useNavigate(); const navigate = useNavigate();
return ( return (
@@ -63,6 +64,11 @@ export default function Sidebar({
onClose(); onClose();
return; return;
} }
if (label === "Отзывы") {
onReviewsClick?.();
onClose();
return;
}
onNavClick(label); onNavClick(label);
onClose(); onClose();
}; };

View File

@@ -36,6 +36,11 @@ export const NavIcons = {
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" /> <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg> </svg>
), ),
star: () => (
<svg width={20} height={20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round">
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
</svg>
),
rules: () => ( rules: () => (
<svg width={20} height={20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round"> <svg width={20} height={20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /> <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />

View File

@@ -8,7 +8,7 @@ export const NAV_ITEMS = [
]; ];
export const NAV_BOTTOM = [ export const NAV_BOTTOM = [
{ icon: "user", label: "Профиль" }, { icon: "star", label: "Отзывы" },
{ icon: "rules", label: "Правила площадки" }, { icon: "rules", label: "Правила площадки" },
]; ];