deleted likes

This commit is contained in:
SlimusMinus
2026-09-13 21:23:49 +03:00
parent b48ccf4c59
commit e2d4f7017b
6 changed files with 43 additions and 47 deletions

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