Skip to content

Commit

Permalink
feat: show sign-in button when trying to access room booking without …
Browse files Browse the repository at this point in the history
…session
  • Loading branch information
ArtemSBulgakov committed Oct 24, 2024
1 parent c34cc78 commit 5c1afa0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/room-booking/RoomBookingPage.tsx
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -11,6 +13,20 @@ export function RoomBookingPage() {
const [newBookingSlot, setNewBookingSlot] = useState<Slot>();
const [bookingDetails, setBookingDetails] = useState<Booking>();

const { me } = useMe();

if (!me) {
return (
<>
<h2 className="my-4 text-3xl font-medium">Sign in to get access</h2>
<p className="mb-4 text-lg text-text-secondary/75">
Access convenient booking service with your Innopolis account.
</p>
<SignInButton />
</>
);
}

return (
<>
<Suspense>
Expand Down

0 comments on commit 5c1afa0

Please sign in to comment.