Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e569d63539 | |||
| 1f5a8c6601 |
@@ -4,6 +4,15 @@ import siteLogo from "../assets/Исходники/logo.png";
|
|||||||
export default function HeaderDesktop() {
|
export default function HeaderDesktop() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleProfileClick = () => {
|
||||||
|
const token = localStorage.getItem("token");
|
||||||
|
if (token) {
|
||||||
|
navigate("/orders");
|
||||||
|
} else {
|
||||||
|
navigate("/login");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="w-full h-27.5 px-16 flex items-center justify-between ">
|
<header className="w-full h-27.5 px-16 flex items-center justify-between ">
|
||||||
<button
|
<button
|
||||||
@@ -54,7 +63,10 @@ export default function HeaderDesktop() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<button className="text-slate-200 hover:text-gold transition-colors duration-200 pr-7">
|
<button
|
||||||
|
className="text-slate-200 hover:text-gold transition-colors duration-200 pr-7"
|
||||||
|
onClick={handleProfileClick}
|
||||||
|
>
|
||||||
<svg
|
<svg
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ import BurgerMenu from "./BurgerMenu";
|
|||||||
|
|
||||||
export default function HeaderMobile() {
|
export default function HeaderMobile() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const handleProfileClick = () => {
|
||||||
|
const token = localStorage.getItem("token");
|
||||||
|
if (token) {
|
||||||
|
navigate("/orders");
|
||||||
|
} else {
|
||||||
|
navigate("/login");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
@@ -32,7 +40,10 @@ export default function HeaderMobile() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<button className="text-slate-200 hover:text-gold transition-colors duration-200 pr-7">
|
<button
|
||||||
|
className="text-slate-200 hover:text-gold transition-colors duration-200 pr-7"
|
||||||
|
onClick={handleProfileClick}
|
||||||
|
>
|
||||||
<svg
|
<svg
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function Cart() {
|
|||||||
<img
|
<img
|
||||||
src={`/static/items/${ci.item.avatar_url}`}
|
src={`/static/items/${ci.item.avatar_url}`}
|
||||||
alt={ci.item.name}
|
alt={ci.item.name}
|
||||||
className="w-40 h-40 object-cover rounded-md shrink-0"
|
className="w-20 md:w-40 h-20 md:h-40 object-cover rounded-md shrink-0"
|
||||||
/>
|
/>
|
||||||
<div className="grow">
|
<div className="grow">
|
||||||
<p className="font-medium text-base md:text-lg">
|
<p className="font-medium text-base md:text-lg">
|
||||||
|
|||||||
Reference in New Issue
Block a user