added reviews
This commit is contained in:
@@ -4,6 +4,7 @@ import RegisterPage from './components/Authentication';
|
||||
import MainFeed from './components/MainFeed';
|
||||
import ChatPage from './components/ChatPage';
|
||||
import ChatListPage from './components/ChatListPage';
|
||||
import ReviewsPage from './components/ReviewsPage';
|
||||
import './styles/chat.css';
|
||||
|
||||
function App() {
|
||||
@@ -15,6 +16,7 @@ function App() {
|
||||
|
||||
<Route path="/register" element={<RegisterPage />} />
|
||||
<Route path="/feed" element={<MainFeed />} />
|
||||
<Route path="/reviews" element={<ReviewsPage />} />
|
||||
<Route path="/chats" element={<ChatListPage />} />
|
||||
<Route path="/chats/:chatId" element={<ChatPage />} />
|
||||
</Routes>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useEffect, useCallback, useMemo } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import "../styles/index.css";
|
||||
import { API_URL } from "../config/authConstants";
|
||||
import Sidebar from "./Sidebar";
|
||||
@@ -17,6 +18,7 @@ import { useAuthContext } from "../context/AuthContext";
|
||||
* остальные компоненты получают данные через пропсы.
|
||||
*/
|
||||
export default function MainFeed() {
|
||||
const navigate = useNavigate();
|
||||
const { user, token, isAuthenticated, logout } = useAuthContext();
|
||||
|
||||
// Открыт ли левый сайдбар (мобильный слайд-аут)
|
||||
@@ -269,6 +271,7 @@ export default function MainFeed() {
|
||||
onLogout={logout}
|
||||
onLoginClick={() => setAuthModalOpen(true)}
|
||||
onRulesClick={() => setRulesModalOpen(true)}
|
||||
onReviewsClick={() => navigate("/reviews")}
|
||||
/>
|
||||
|
||||
<div className="f-main">
|
||||
|
||||
@@ -15,6 +15,7 @@ export default function Sidebar({
|
||||
onLogout,
|
||||
onLoginClick,
|
||||
onRulesClick,
|
||||
onReviewsClick,
|
||||
}) {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
@@ -63,6 +64,11 @@ export default function Sidebar({
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
if (label === "Отзывы") {
|
||||
onReviewsClick?.();
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
onNavClick(label);
|
||||
onClose();
|
||||
};
|
||||
|
||||
@@ -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" />
|
||||
</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: () => (
|
||||
<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" />
|
||||
|
||||
@@ -8,7 +8,7 @@ export const NAV_ITEMS = [
|
||||
];
|
||||
|
||||
export const NAV_BOTTOM = [
|
||||
{ icon: "user", label: "Профиль" },
|
||||
{ icon: "star", label: "Отзывы" },
|
||||
{ icon: "rules", label: "Правила площадки" },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user