From 5c1afa055b5b4588486c77e4ffcddc57d612a785 Mon Sep 17 00:00:00 2001 From: Artem Bulgakov Date: Thu, 24 Oct 2024 12:19:01 +0300 Subject: [PATCH] feat: show sign-in button when trying to access room booking without session --- .../room-booking/RoomBookingPage.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/room-booking/RoomBookingPage.tsx b/src/components/room-booking/RoomBookingPage.tsx index c88e40b..1cd1d88 100644 --- a/src/components/room-booking/RoomBookingPage.tsx +++ b/src/components/room-booking/RoomBookingPage.tsx @@ -1,6 +1,8 @@ +import { useMe } from "@/api/accounts/user.ts"; +import { SignInButton } from "@/components/common/SignInButton.tsx"; +import { BookingModal } from "@/components/room-booking/BookingModal.tsx"; import { lazy, Suspense, useState } from "react"; import type { Booking, Slot } from "./BookingTimeline.vue"; -import { BookingModal } from "@/components/room-booking/BookingModal.tsx"; const BookingTimeline = lazy( () => import("@/components/room-booking/BookingTimeline.tsx"), @@ -11,6 +13,20 @@ export function RoomBookingPage() { const [newBookingSlot, setNewBookingSlot] = useState(); const [bookingDetails, setBookingDetails] = useState(); + const { me } = useMe(); + + if (!me) { + return ( + <> +

Sign in to get access

+

+ Access convenient booking service with your Innopolis account. +

+ + + ); + } + return ( <>