Allow unauthenticated users to view and select dates, login only on book
All checks were successful
Build frontend / build (push) Successful in 43s
All checks were successful
Build frontend / build (push) Successful in 43s
This commit is contained in:
@ -238,10 +238,6 @@ export default function PropertyDetailsPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCalendarClick = (dateStr) => {
|
const handleCalendarClick = (dateStr) => {
|
||||||
if (!AuthService.isAuthenticated()) {
|
|
||||||
setShowLoginDialog(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!isDateAvailable(dateStr)) return;
|
if (!isDateAvailable(dateStr)) return;
|
||||||
|
|
||||||
if (!bookingDates.start || selectingEnd) {
|
if (!bookingDates.start || selectingEnd) {
|
||||||
@ -610,17 +606,6 @@ export default function PropertyDetailsPage() {
|
|||||||
|
|
||||||
{/* Calendar */}
|
{/* Calendar */}
|
||||||
<div className="mb-4 relative">
|
<div className="mb-4 relative">
|
||||||
{!AuthService.isAuthenticated() && (
|
|
||||||
<div
|
|
||||||
onClick={() => setShowLoginDialog(true)}
|
|
||||||
className="absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm rounded-xl cursor-pointer"
|
|
||||||
>
|
|
||||||
<div className="text-center">
|
|
||||||
<LogIn className="w-8 h-8 text-gray-400 mx-auto mb-2" />
|
|
||||||
<p className="text-sm text-gray-500 font-medium">سجّل الدخول لعرض التواريخ المتاحة</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="flex items-center justify-between mb-3">
|
<div className="flex items-center justify-between mb-3">
|
||||||
<button onClick={() => setCalendarMonth(new Date(calendarMonth.getFullYear(), calendarMonth.getMonth() - 1))} className="p-1 hover:bg-gray-100 rounded-lg">
|
<button onClick={() => setCalendarMonth(new Date(calendarMonth.getFullYear(), calendarMonth.getMonth() - 1))} className="p-1 hover:bg-gray-100 rounded-lg">
|
||||||
<ChevronRight className="w-5 h-5" />
|
<ChevronRight className="w-5 h-5" />
|
||||||
@ -662,8 +647,8 @@ export default function PropertyDetailsPage() {
|
|||||||
cells.push(
|
cells.push(
|
||||||
<button
|
<button
|
||||||
key={dateStr}
|
key={dateStr}
|
||||||
onClick={() => !isPast && AuthService.isAuthenticated() && handleCalendarClick(dateStr)}
|
onClick={() => !isPast && handleCalendarClick(dateStr)}
|
||||||
disabled={isPast || !available || !AuthService.isAuthenticated()}
|
disabled={isPast || !available}
|
||||||
className={`w-full aspect-square rounded-lg text-sm font-medium transition-all ${
|
className={`w-full aspect-square rounded-lg text-sm font-medium transition-all ${
|
||||||
isStart || isEnd
|
isStart || isEnd
|
||||||
? 'bg-amber-500 text-white'
|
? 'bg-amber-500 text-white'
|
||||||
|
|||||||
Reference in New Issue
Block a user