added carousel image on post on mainFeed
This commit is contained in:
@@ -7,7 +7,6 @@ import Sidebar from "../components/Sidebar";
|
||||
import BottomNav from "../components/nav/BottomNav";
|
||||
import RightSidebar from "../components/RightSidebar";
|
||||
import CreateUpdatePostLegacy from "./CreateUpdatePost";
|
||||
import ImageViewer from "../components/ImageViewer";
|
||||
import CityFilterLegacy from "../components/CityFilter";
|
||||
import { ProfileModal } from "../components/profile";
|
||||
import AuthModal from "../components/AuthModal";
|
||||
@@ -240,10 +239,6 @@ export default function MainFeed() {
|
||||
activeNav === "home" && selectedCities.length === 0 && feed.hasMore && !feed.loading && !feed.loadingMore
|
||||
);
|
||||
|
||||
const handleImageClick = useCallback((images: string[], index: number, ad: Record<string, unknown>) => {
|
||||
if (images?.length) modals.open("viewer", { images, index, ad });
|
||||
}, [modals]);
|
||||
|
||||
const handleCreatePost = useCallback(() => {
|
||||
if (!isAuthenticated) modals.open("auth");
|
||||
else modals.open("create");
|
||||
@@ -491,7 +486,6 @@ export default function MainFeed() {
|
||||
onDelete={actions.handleDelete}
|
||||
onMarkFound={actions.handleMarkFound}
|
||||
onReopen={actions.handleReopen}
|
||||
onImageClick={handleImageClick}
|
||||
onLocationClick={handleLocationClick}
|
||||
onAuthRequired={() => modals.open("auth")}
|
||||
t={t}
|
||||
@@ -552,22 +546,10 @@ export default function MainFeed() {
|
||||
|
||||
{modals.isOpen("rules") && <RulesModal onClose={modals.close} />}
|
||||
|
||||
{modals.isOpen("viewer") && (
|
||||
<ImageViewer
|
||||
images={modals.modal.payload.images}
|
||||
initialIndex={modals.modal.payload.index}
|
||||
onClose={modals.close}
|
||||
postData={modals.modal.payload.ad}
|
||||
/>
|
||||
)}
|
||||
|
||||
{modals.isOpen("postDetail") && (
|
||||
<PostDetailModal
|
||||
postId={modals.modal.payload.postId}
|
||||
onClose={modals.close}
|
||||
onImageClick={(images: string[], index: number, ad: Record<string, unknown>) => {
|
||||
modals.open("viewer", { images, index, ad });
|
||||
}}
|
||||
onLocationClick={(ad: Record<string, unknown>) => {
|
||||
modals.close();
|
||||
void handleLocationClick(ad);
|
||||
|
||||
Reference in New Issue
Block a user