add persons, / footer(contacts) / main car page

This commit is contained in:
aurinex
2025-07-12 01:46:43 +05:00
parent 643960cadb
commit 2bc57b7d0b
11 changed files with 1011 additions and 50 deletions

View File

@ -14,22 +14,25 @@ import logo from "../assets/icon/autobro.png";
import { useResponsive } from "../theme/useResponsive";
import Feedback from "./Feedback";
import { scrollToAnchor } from "../utils/scrollUtils";
import { useNavigate } from "react-router-dom";
const Header = () => {
const { isMobile } = useResponsive();
const [drawerOpen, setDrawerOpen] = useState(false);
const [feedbackOpen, setFeedbackOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
const navigate = useNavigate();
const menuItems = [
// { title: "", anchor: "#main" },
{ title: "О нас", anchor: "#about-us" },
{ title: "Этапы работы", anchor: "#stages" },
{ title: "В наличии", anchor: "#available" },
{ title: "Калькулятор", anchor: "#calculator" },
{ title: "Команда", anchor: "#team" },
{ title: "Отзывы", anchor: "#reviews" },
{ title: "Контакты", anchor: "#contacts" },
{ title: "В наличии", anchor: "#available" },
{ title: "Команда", anchor: "#team" },
{ title: "Доставленные авто", anchor: "#delivered" },
{ title: "Этапы работы", anchor: "#stages" },
{ title: " ", anchor: "#main" },
// { title: "Доставленные авто", anchor: "#delivered" },
];
// Отслеживание скролла
@ -62,7 +65,11 @@ const Header = () => {
// Используем глобальную функцию из utils
const handleScrollToAnchor = (anchor: string) => {
scrollToAnchor(anchor, setDrawerOpen, isMobile);
if (location.pathname.startsWith("/car")) {
navigate("/");
} else {
scrollToAnchor(anchor, setDrawerOpen, isMobile);
}
};
return (
@ -153,7 +160,7 @@ const Header = () => {
</Box>
{/* Пустой блок для компенсации фиксированного хедера */}
<Box sx={{ height: isMobile ? "15vw" : "10vw", bgcolor: "#2D2D2D" }} />
<Box sx={{ height: isMobile ? "15vw" : location.pathname.startsWith("/car") ? "5vw" : "10vw", bgcolor: "#2D2D2D" }} />
{/* Мобильное меню */}
<Drawer anchor="right" open={drawerOpen} onClose={toggleDrawer(false)}>