Skip to content

Commit 3704191

Browse files
committed
part-15
1 parent 34d6edc commit 3704191

31 files changed

Lines changed: 1118 additions & 90 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "bun --bun next dev",
6+
"dev": "bun --bun next dev --webpack",
77
"build": "bun --bun next build",
88
"start": "bun --bun next start",
99
"lint": "eslint"

src/app/(commonLayout)/consultation/doctor/[id]/page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2+
import BookAppointmentModal from "@/components/modules/Patient/Appointments/BookAppointmentModal"
23
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
34
import { Badge } from "@/components/ui/badge"
45
import { Button } from "@/components/ui/button"
6+
import { getUserInfo } from "@/services/auth.services"
57
import { getDoctorById } from "@/services/doctor.services"
68
import { type IDoctorDetails } from "@/types/doctor.types"
79
import { format } from "date-fns"
@@ -45,6 +47,7 @@ const ConsultationDoctorByIdPage = async ({
4547
params: Promise<{ id: string }>
4648
}) => {
4749
const { id } = await params
50+
const currentUser = await getUserInfo()
4851

4952
let doctorDetails: IDoctorDetails | null = null
5053
let errorMessage = ""
@@ -145,6 +148,15 @@ const ConsultationDoctorByIdPage = async ({
145148
<Badge variant="outline">Fee: ${doctorDetails.appointmentFee?.toFixed(2) ?? "N/A"}</Badge>
146149
<Badge variant="outline">Rating: {doctorDetails.averageRating?.toFixed(1) ?? "0.0"}</Badge>
147150
</div>
151+
152+
<div className="pt-3">
153+
<BookAppointmentModal
154+
doctorId={String(doctorDetails.id)}
155+
doctorName={doctorDetails.name}
156+
isAuthenticated={Boolean(currentUser)}
157+
viewerRole={currentUser?.role ?? null}
158+
/>
159+
</div>
148160
</div>
149161
</div>
150162
</div>

src/app/(commonLayout)/consultation/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import DoctorsList from "@/components/modules/Consultation/DoctorsList";
22
import { getAllSpecialties, getDoctors } from "@/services/doctor.services";
3+
import { getUserInfo } from "@/services/auth.services";
34
import { dehydrate, HydrationBoundary, QueryClient } from "@tanstack/react-query";
45

56
const SPECIALTIES_FILTER_KEY = "specialties.specialty.title";
@@ -53,6 +54,7 @@ const ConsultationPage = async ({
5354
});
5455

5556
const queryString = normalizedQueryParams.toString();
57+
const currentUser = await getUserInfo();
5658

5759
const queryClient = new QueryClient();
5860

@@ -71,7 +73,11 @@ const ConsultationPage = async ({
7173
});
7274
return (
7375
<HydrationBoundary state={dehydrate(queryClient)}>
74-
<DoctorsList initialQueryString={queryString} />
76+
<DoctorsList
77+
initialQueryString={queryString}
78+
isAuthenticated={Boolean(currentUser)}
79+
viewerRole={currentUser?.role ?? null}
80+
/>
7581
</HydrationBoundary>
7682
);
7783
}

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/book-appointments/loading.tsx

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/book-appointments/page.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/health-records/loading.tsx

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/health-records/page.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/loading.tsx

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/my-appointments/loading.tsx

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/(dashboardLayout)/(patientRouteGroup)/(patientDashboardLayout)/dashboard/my-appointments/page.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)