From 815200047f089917cb2f22c93b41ef11031d59ad Mon Sep 17 00:00:00 2001
From: Yehia Rasheed <157399068+yehiarasheed@users.noreply.github.com>
Date: Sat, 17 Jan 2026 22:34:54 +0200
Subject: [PATCH 1/2] Fix Give Feedback button logic and remove Reapply from
vendor rejected requests
- Update EventCard to show Give Feedback only for past events using endDate/end-of-day comparison
- Remove Reapply button from VendorDashboard rejected applications tab
---
client/src/components/EventCard.tsx | 41 +++++++++++++++++++++++++---
client/src/pages/VendorDashboard.tsx | 14 ++--------
2 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/client/src/components/EventCard.tsx b/client/src/components/EventCard.tsx
index aafb3a07..7d3e35bb 100644
--- a/client/src/components/EventCard.tsx
+++ b/client/src/components/EventCard.tsx
@@ -709,6 +709,41 @@ export default function EventCard({
};
const now = new Date();
+
+ const parseEventDateForComparison = (
+ dateString?: string,
+ boundary: "start" | "end" = "start"
+ ) => {
+ if (!dateString) return null;
+
+ const ymdMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateString);
+ if (ymdMatch) {
+ const year = Number(ymdMatch[1]);
+ const monthIndex = Number(ymdMatch[2]) - 1;
+ const day = Number(ymdMatch[3]);
+ const hours = boundary === "end" ? 23 : 0;
+ const minutes = boundary === "end" ? 59 : 0;
+ const seconds = boundary === "end" ? 59 : 0;
+ const ms = boundary === "end" ? 999 : 0;
+ return new Date(year, monthIndex, day, hours, minutes, seconds, ms);
+ }
+
+ const parsed = new Date(dateString);
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
+ };
+
+ // Feedback should only be available for past events.
+ // Prefer endDate when available; for date-only strings, compare against end-of-day.
+ const feedbackComparisonDate =
+ parseEventDateForComparison(endDate ?? startDate, "end") ??
+ parseEventDateForComparison(startDate, "end");
+ const canShowFeedbackAction = Boolean(
+ onFeedback &&
+ registered &&
+ feedbackComparisonDate &&
+ now > feedbackComparisonDate
+ );
+
const deadline = registrationDeadline ? new Date(registrationDeadline) : null;
const isBeforeDeadline = !deadline || now <= deadline;
const hasCapacity = !capacity || localAttendeeCount < capacity;
@@ -989,7 +1024,7 @@ export default function EventCard({
{/* ACTION BUTTONS (Detailed View) */}
- {registered && startDate && new Date() > new Date(startDate) ? (
+ {canShowFeedbackAction ? (
<>
@@ -1479,13 +1477,7 @@ export default function VendorDashboard() {
)}
-
- Reapply
-
+ {/* Reapply action intentionally removed */}
))
From 585503b8e61a8d23a8b8165a2f25fd24ad82fcbc Mon Sep 17 00:00:00 2001
From: Yehia Rasheed <157399068+yehiarasheed@users.noreply.github.com>
Date: Sat, 17 Jan 2026 22:54:59 +0200
Subject: [PATCH 2/2] fix: remove unused location state and clean up search
term handling in VendorDashboard
---
client/src/pages/VendorDashboard.tsx | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/client/src/pages/VendorDashboard.tsx b/client/src/pages/VendorDashboard.tsx
index 7de6dfbe..28ca91e7 100644
--- a/client/src/pages/VendorDashboard.tsx
+++ b/client/src/pages/VendorDashboard.tsx
@@ -57,7 +57,6 @@ import ApplicationPaymentDialog from "@/components/ApplicationPaymentDialog";
import IdUploadButton from "@/components/IdUploadButton";
import { bazaarApiService, Application, Bazaar } from "@/lib/bazaarApi";
import { useToast } from "@/hooks/use-toast";
-import { useLocation } from "wouter";
interface Attendee {
name: string;
@@ -66,7 +65,6 @@ interface Attendee {
}
export default function VendorDashboard() {
- const [_location, _setLocation] = useLocation();
const [showApplyDialog, setShowApplyDialog] = useState(false);
const [selectedBazaar, setSelectedBazaar] = useState(null);
const [upcomingBazaars, setUpcomingBazaars] = useState([]);
@@ -84,7 +82,7 @@ export default function VendorDashboard() {
>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
- const [searchTerm, setSearchTerm] = useState("");
+ const [searchTerm, _setSearchTerm] = useState("");
const [companyName, setCompanyName] = useState("");
// Platform booth form state
@@ -93,10 +91,8 @@ export default function VendorDashboard() {
>([{ name: "", email: "" }]);
const [boothSize, setBoothSize] = useState<"2x2" | "4x4">("2x2");
const [durationWeeks, setDurationWeeks] = useState(1);
- const [_locationPreference, _setLocationPreference] = useState("");
const [selectedMapLocation, setSelectedMapLocation] = useState("");
- const [_isSubmittingPlatformBooth, setIsSubmittingPlatformBooth] =
- useState(false);
+ const [, setIsSubmittingPlatformBooth] = useState(false);
// Booth application dialog state
const [boothApplicationOpen, setBoothApplicationOpen] = useState(false);
@@ -150,10 +146,6 @@ export default function VendorDashboard() {
};
// Handle search functionality
- const _handleSearch = (query: string) => {
- setSearchTerm(query);
- };
-
// Filter data based on search term
const getFilteredData = (data: any[], searchFields: string[]) => {
if (!searchTerm) return data;