diff --git a/client/src/components/Patient/BookAppointment/BookingSummary.jsx b/client/src/components/Patient/BookAppointment/BookingSummary.jsx index 762dad2..694cecb 100644 --- a/client/src/components/Patient/BookAppointment/BookingSummary.jsx +++ b/client/src/components/Patient/BookAppointment/BookingSummary.jsx @@ -63,7 +63,7 @@ const BookingSummary = ({ -
+
@@ -72,6 +72,17 @@ const BookingSummary = ({
₹{consultationFee}
+ +
+
+ QuickClinic Commission + 1% +
+
+ Our platform fee + ₹{Math.round(consultationFee * 0.01)} +
+
diff --git a/client/src/components/quicklab/DesktopNavbar.jsx b/client/src/components/quicklab/DesktopNavbar.jsx index e137123..8a35ea3 100644 --- a/client/src/components/quicklab/DesktopNavbar.jsx +++ b/client/src/components/quicklab/DesktopNavbar.jsx @@ -8,6 +8,7 @@ import { Calendar, TestTube, Settings, + MapPin, } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../../context/authContext'; @@ -242,6 +243,18 @@ export default function DesktopNavbar({ searchQuery, setSearchQuery }) { {/* Dark Mode Toggle */} + {/* Nearby Labs Button - Always visible for public and patients */} + {(!isAuthenticated || user?.role === 'patient') && ( + + )} + {/* Explore Dropdown (Quick Clinic / Quick Med) for patients & public */} {(!isAuthenticated || user?.role === 'patient') && (
diff --git a/client/src/components/quicklab/MobileNavbar.jsx b/client/src/components/quicklab/MobileNavbar.jsx index 5279401..11950b8 100644 --- a/client/src/components/quicklab/MobileNavbar.jsx +++ b/client/src/components/quicklab/MobileNavbar.jsx @@ -11,6 +11,7 @@ import { Calendar, TestTube, Settings, + MapPin, } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../../context/authContext'; @@ -248,6 +249,17 @@ export default function MobileNavbar({ searchQuery, setSearchQuery }) {
+ {/* Nearby Labs Button - Always visible for public and patients */} + {(!isAuthenticated || user?.role === 'patient') && ( + + )} + {/* Explore toggle for patients & public */} {(!isAuthenticated || user?.role === 'patient') && ( <> diff --git a/client/src/components/quickmed/Navbar.jsx b/client/src/components/quickmed/Navbar.jsx index 7f08a54..fd7b0ea 100644 --- a/client/src/components/quickmed/Navbar.jsx +++ b/client/src/components/quickmed/Navbar.jsx @@ -123,7 +123,7 @@ const Navbar = () => { {/* Desktop Navigation */}
{/* Explore Dropdown (patients & public) */} - {(!isAuthenticated || user?.role === 'patient') && ( +
)}
- )} + diff --git a/client/src/pages/quicklab/LabDetails.jsx b/client/src/pages/quicklab/LabDetails.jsx index 0bdeaee..823457b 100644 --- a/client/src/pages/quicklab/LabDetails.jsx +++ b/client/src/pages/quicklab/LabDetails.jsx @@ -464,10 +464,21 @@ export default function LabDetails() {
-
+
Total ₹{calculateTotal()}
+ +
+
+ QuickClinic Commission + 1% +
+
+ Our platform fee + ₹{Math.round(calculateTotal() * 0.01)} +
+
+

Nearby Labs

+
+ + {/* Location Display */} + {detectedCity && ( +
+ + + Showing labs in {detectedCity} + + +
+ )} + + + + {/* City Change Modal */} + {showCityModal && ( +
setShowCityModal(false)} + > +
e.stopPropagation()} + > +

Change Location

+
+ + setNewCity(e.target.value)} + onKeyPress={(e) => e.key === 'Enter' && handleSaveCity()} + placeholder="e.g., Mumbai, Delhi, Bangalore" + className="w-full px-4 py-2 border border-lab-black-300 rounded-lg focus:ring-2 focus:ring-lab-yellow-500 focus:border-transparent" + autoFocus + /> +
+
+ + +
+
+
+ )} + + {/* Results */} +
+ {loading ? ( +
+ +

Finding nearby labs...

+
+ ) : labs.length === 0 ? ( +
+ +

No labs found in {detectedCity}

+

Try searching in a different location

+ +
+ ) : ( + <> +
+

+ Found {labs.length} labs nearby +

+
+ +
+ {labs.map((lab) => ( +
handleLabClick(lab._id)} + className="card-quicklab bg-white border border-lab-black-100 hover:shadow-xl transition-all cursor-pointer overflow-hidden transform hover:-translate-y-1" + > + {/* Lab Logo */} + {lab.logo ? ( + {lab.name} + ) : ( +
+
+
+ {lab.name.charAt(0)} +
+
+
+ )} + +
+ {/* Lab Name */} +

+ {lab.name} +

+ + {/* Rating */} + {lab.ratings?.average > 0 && ( +
+
+ + + {lab.ratings.average.toFixed(1)} + +
+ + ({lab.ratings.count} {lab.ratings.count === 1 ? 'review' : 'reviews'}) + +
+ )} + + {/* Address */} + {lab.address && ( +
+ +
+

+ {lab.address.street && `${lab.address.street}, `} + {lab.address.city} +

+

+ {lab.address.state} {lab.address.zipCode} +

+
+
+ )} + + {/* Contact */} +
+ {lab.contact?.phone && ( +
+ + {lab.contact.phone} +
+ )} + {lab.contact?.email && ( +
+ + {lab.contact.email} +
+ )} +
+ + {/* Tests Count */} + {lab.tests && lab.tests.length > 0 && ( +
+

+ {lab.tests.length} tests available +

+
+ )} + + {/* Home Collection Badge */} + {lab.generalHomeCollectionFee !== undefined && ( +
+ + + Home Collection Available + +
+ )} + + {/* Click to View Button */} + +
+
+ ))} +
+ + )} +
+ + ); +} diff --git a/client/src/routes/QuickLabRoutes.jsx b/client/src/routes/QuickLabRoutes.jsx index 7c5a423..9dcc860 100644 --- a/client/src/routes/QuickLabRoutes.jsx +++ b/client/src/routes/QuickLabRoutes.jsx @@ -2,6 +2,7 @@ import { Routes, Route } from 'react-router-dom'; import Navbar from '../components/quicklab/Navbar'; import QuickLabHomepage from '../pages/quicklab/Homepage'; import LabSearchResults from '../pages/quicklab/LabSearchResults'; +import NearbyLabs from '../pages/quicklab/NearbyLabs'; import LabDetails from '../pages/quicklab/LabDetails'; import LabAdminProfileComplete from '../pages/quicklab/LabAdminProfileComplete'; import LabAdminAddLab from '../pages/quicklab/LabAdminAddLab'; @@ -170,6 +171,9 @@ export default function QuickLabRoutes() { {/* Public homepage */} } /> + {/* Nearby Labs */} + } /> + {/* Lab Search Results */} } />