Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@codemirror/search": "6.7.1",
"@codemirror/state": "6.7.1",
"@codemirror/view": "6.43.9",
"@flamingo-stack/openframe-frontend-core": "0.0.811",
"@flamingo-stack/openframe-frontend-core": "0.0.812",
"@hookform/resolvers": "5.2.2",
"@lezer/highlight": "1.2.3",
"@tanstack/react-query": "5.90.21",
Expand Down
53 changes: 10 additions & 43 deletions apps/web/src/app/(app)/setup/components/book-call-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,26 @@
'use client';

import { HubSpotMeetingScheduler } from '@flamingo-stack/openframe-frontend-core/components/meeting-scheduler';
import { LoadingWhen } from '@flamingo-stack/openframe-frontend-core/components/ui';
import { useToast } from '@flamingo-stack/openframe-frontend-core/hooks';
import type { BookingConfirmation } from '@flamingo-stack/openframe-frontend-core/schemas/meeting-booking-schema';
import { MeetingSchedulerModal } from '@flamingo-stack/openframe-frontend-core/components/meeting-scheduler';
import { CONTENT_BASE } from '@/app/(app)/help-center/endpoints';
import { useOnboardingMeetingLink } from '@/app/(app)/onboarding/components/book-call/use-onboarding-meeting-link';
import { SimpleModal } from '@/app/components/shared/simple-modal';
import { formatDateTime } from '@/lib/format-date';

/**
* "Book an Onboarding Call": the lib's HubSpot scheduler on the hub's onboarding
* link, in a modal - its modal layout (host strip, timezone, calendar beside the
* times, Continue under the card), which the 600px window has the room for.
* Same link and same booked toast as the dashboard promo's inline scheduler;
* the modal closes on a confirmed booking, and on a phone's Cancel.
* "Book an Onboarding Call": the lib's booking window on the hub's onboarding
* link. The window, the scheduler inside it and the booked toast are the lib's;
* this binds the title, the link this app books and the `/content` proxy base.
*/
export function BookCallModal({ open, onClose }: { open: boolean; onClose: () => void }) {
const { toast } = useToast();
const { link, isLoading } = useOnboardingMeetingLink();

return (
<SimpleModal
<MeetingSchedulerModal
isOpen={open}
onClose={onClose}
title="Book an Onboarding Call"
className="md:max-w-[600px]"
// The window scrolls as a whole on a phone (the scheduler's footer rides
// with the card); without this slot the body has no scroll box at all.
contentClassName="flex flex-col"
>
{link || isLoading ? (
// While the link is read the scheduler draws its own loading state, in the same tree, so nothing remounts
// when the link lands.
<LoadingWhen loading={!link}>
<HubSpotMeetingScheduler
layout="modal"
meetingId={link?.id ?? ''}
apiBaseUrl={CONTENT_BASE}
hosts={link?.hosts}
fallbackUrl={link?.link}
onBack={onClose}
onBooked={(booking: BookingConfirmation) => {
toast({
title: 'Call booked',
description: `${booking.title} - ${formatDateTime(booking.startTimeMs)}. Check your email for the invite.`,
variant: 'success',
});
onClose();
}}
/>
</LoadingWhen>
) : (
<p className="text-ods-text-secondary text-h4">No onboarding calls can be booked right now.</p>
)}
</SimpleModal>
link={link}
loading={isLoading}
apiBaseUrl={CONTENT_BASE}
emptyMessage="No onboarding calls can be booked right now."
/>
);
}
Loading