Merge pull request #69 from SlimusMinus/del-likes

deleted likes
This commit is contained in:
SlimusMinus
2026-09-13 21:24:42 +03:00
committed by GitHub
6 changed files with 43 additions and 47 deletions

View File

@@ -11,12 +11,14 @@ import { useLanguageToggle } from "../hooks/useLanguageToggle";
import { useTranslation } from 'react-i18next';
import SupportModal from "./SupportModal";
import ProfileAvatar from "./profile/ProfileAvatar";
import NahodkaLogo from "./NahodkaLogo";
export default function Sidebar({
open,
activeNav,
onClose,
onNavClick,
onLogoClick,
isAuthenticated,
onLoginClick,
onRulesClick,
@@ -66,6 +68,17 @@ export default function Sidebar({
<div className={`f-overlay${open ? " show" : ""}`} onClick={onClose} />
<div className={`f-sidebar${open ? " open" : ""}`}>
<div className="f-sb-head">
<button
type="button"
className="f-sb-logo-btn"
onClick={() => {
onLogoClick?.();
onClose();
}}
title={t('nav.home')}
>
<NahodkaLogo />
</button>
</div>
<nav className="f-sb-nav">
{NAV_ITEMS.map(({ icon, key: itemKey, labelKey }) => {

View File

@@ -4,7 +4,6 @@ export const NAV_ITEMS = [
{ icon: "box", key: "items", labelKey: "nav.items" },
{ icon: "paw", key: "pets", labelKey: "nav.pets" },
{ icon: "file", key: "myads", labelKey: "nav.myAds" },
{ icon: "heart", key: "favorites", labelKey: "nav.favorites" },
{ icon: "plus", key: "create", labelKey: "nav.create" },
];

View File

@@ -396,6 +396,7 @@ export default function MainFeed() {
open={sidebarOpen}
activeNav={activeNav}
onClose={() => setSidebarOpen(false)}
onLogoClick={handleHomeClick}
onNavClick={(key: string) => {
setActiveNav(key);
setSearchQuery("");

View File

@@ -2,7 +2,6 @@ import {useRef, useState, useEffect} from "react";
import PinIcon from "../components/icons/PinIcon";
import CalendarIcon from "../components/icons/CalendarIcon";
import PhoneIcon from "../components/icons/PhoneIcon";
import HeartIcon from "../components/icons/HeartIcon";
import TrashIcon from "../components/icons/TrashIcon";
import {useContactSeller} from "../hooks/useContactSeller";
import {useAuthContext} from "../context/AuthContext";
@@ -12,7 +11,7 @@ import RewardPopup from "../components/feed/RewardPopup";
import Toast from "../components/Toast";
import {useTranslation} from 'react-i18next';
export default function PostOnFeed({ ad, liked, likeCountAdj, onLike, onEdit, onDelete, onMarkFound, isOwner, onImageClick, onLocationClick, onAuthRequired, compact }) {
export default function PostOnFeed({ ad, onEdit, onDelete, onMarkFound, isOwner, onImageClick, onLocationClick, onAuthRequired, compact }) {
const { t } = useTranslation();
const [showCalendar, setShowCalendar] = useState(false);
const [showReward, setShowReward] = useState(false);
@@ -89,15 +88,18 @@ export default function PostOnFeed({ ad, liked, likeCountAdj, onLike, onEdit, on
{!compact && (
<div className="f-card-actions">
<div className="f-card-actions-left">
<button type="button"
className={`f-card-icon-btn${liked ? " liked" : ""}`}
{address && (
<div
className="f-meta-pill f-loc-pill"
title={t('postCard.showOnMap', { address })}
onClick={e => {
e.stopPropagation();
onLike(ad.id);
}}>
<HeartIcon filled={liked}/>
</button>
<span className="f-card-like-count">{(ad.likeCount || 0) + likeCountAdj}</span>
onLocationClick?.(ad);
}}
>
<PinIcon/> {address}
</div>
)}
</div>
<div className="f-card-actions-right">
{onEdit && isOwner && !isClosed && (
@@ -153,18 +155,6 @@ export default function PostOnFeed({ ad, liked, likeCountAdj, onLike, onEdit, on
{!compact && (
<div className="f-card-meta">
{address && (
<div
className="f-meta-pill f-loc-pill"
title={t('postCard.showOnMap', { address })}
onClick={e => {
e.stopPropagation();
onLocationClick?.(ad);
}}
>
<PinIcon/> {address}
</div>
)}
{ad.reward && (
<>
<button

View File

@@ -88,25 +88,6 @@
.f-card-actions-left, .f-card-actions-right {
display: flex; align-items: center; gap: 6px;
}
.f-card-icon-btn {
background: none; border: none; cursor: pointer;
color: var(--text-primary);
width: 38px; height: 38px;
display: flex; align-items: center; justify-content: center;
border-radius: 50%;
transition: background .15s, transform .15s, color .15s;
padding: 0;
}
.f-card-icon-btn:hover { background: var(--hover-bg); transform: scale(1.08); }
.f-card-icon-btn:active { transform: scale(.92); }
.f-card-icon-btn.liked { color: #ed4956; }
.f-card-icon-btn.liked svg { fill: #ed4956; stroke: #ed4956; }
.f-card-icon-btn svg { transition: transform .15s; width: 24px; height: 24px; }
.f-card-like-count {
color: var(--text-primary); font-weight: 800; font-size: .9rem;
line-height: 1;
}
.f-card-reward-text {
display: inline-block;
@@ -220,13 +201,9 @@ button.f-card-reward-btn:focus-visible {
/* ── Meta pills ── */
.f-card-meta {
display: flex; flex-wrap: wrap; align-items: center;
display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
gap: 6px; padding: 8px 16px 4px;
}
.f-card-meta .f-date-pill,
.f-card-meta .f-card-reward-text {
margin-left: auto;
}
.f-meta-pill {
display: inline-flex; align-items: center; gap: 4px;
background: rgba(var(--teal-rgb), .1);

View File

@@ -1,9 +1,25 @@
/* ── Left Navigation (Instagram-style) ── */
.f-sb-head {
padding: 0;
padding: 12px 12px 4px;
display: flex; align-items: center; gap: 11px;
}
.f-sb-logo-btn {
display: flex; align-items: center;
flex-shrink: 0;
background: none; border: none; cursor: pointer;
padding: 0;
border-radius: 10px;
transition: filter .15s, transform .15s;
}
.f-sb-logo-btn:hover { filter: brightness(1.08); transform: scale(1.02); }
.f-sb-logo-btn:active { transform: scale(.97); }
.f-sb-logo-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.f-sb-logo-btn svg {
height: 40px;
width: auto;
display: block;
}
.f-sb-logo {
width: 40px; height: 40px;
background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);