feat: cal video settings (#21347)
* feat: cal video settings * fix: var names * feat: finish setting * chore: add enabled * chore: remove logs * feat: support redirect url on exit * feat: finish settings * refactor: improve UI * chore: remove logs * fix: type err * fix: finish redirect url * fix: add type * chore: change schema * fix: type error * chore: improvements * chore: remove index * feat: add organizer * chore: remove log * chore: use safe parse * fix: add nullable * refactor: hide toggles if platorm * chore: update description --------- Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: supalarry <[email protected]>
This commit is contained in:
16 files changed
+329
-23
No files matched your search
@@ -37,7 +37,13 @@ import { STEPS } from "~/apps/installation/[[...step]]/constants";
|
||||
export type TEventType = EventTypeAppSettingsComponentProps["eventType"] &
|
||||
Pick<
|
||||
EventTypeModel,
|
||||
"metadata" | "schedulingType" | "slug" | "requiresConfirmation" | "position" | "destinationCalendar"
|
||||
| "metadata"
|
||||
| "schedulingType"
|
||||
| "slug"
|
||||
| "requiresConfirmation"
|
||||
| "position"
|
||||
| "destinationCalendar"
|
||||
| "calVideoSettings"
|
||||
> & {
|
||||
selected: boolean;
|
||||
locations: LocationFormValues["locations"];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import type { DailyCall } from "@daily-co/daily-js";
|
||||
import DailyIframe from "@daily-co/daily-js";
|
||||
import { DailyProvider } from "@daily-co/daily-react";
|
||||
import { useDailyEvent } from "@daily-co/daily-react";
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
@@ -33,6 +34,8 @@ export default function JoinCall(props: PageProps) {
|
||||
calVideoLogo,
|
||||
displayLogInOverlay,
|
||||
loggedInUserName,
|
||||
showRecordingButton,
|
||||
rediectAttendeeToOnExit,
|
||||
} = props;
|
||||
const [daily, setDaily] = useState<DailyCall | null>(null);
|
||||
|
||||
@@ -65,12 +68,16 @@ export default function JoinCall(props: PageProps) {
|
||||
...(typeof meetingPassword === "string" && { token: meetingPassword }),
|
||||
...(hasTeamPlan && {
|
||||
customTrayButtons: {
|
||||
recording: {
|
||||
label: "Record",
|
||||
tooltip: "Start or stop recording",
|
||||
iconPath: RECORDING_DEFAULT_ICON,
|
||||
iconPathDarkMode: RECORDING_DEFAULT_ICON,
|
||||
},
|
||||
...(showRecordingButton
|
||||
? {
|
||||
recording: {
|
||||
label: "Record",
|
||||
tooltip: "Start or stop recording",
|
||||
iconPath: RECORDING_DEFAULT_ICON,
|
||||
iconPathDarkMode: RECORDING_DEFAULT_ICON,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
transcription: {
|
||||
label: "Cal.ai",
|
||||
tooltip: "Transcription powered by AI",
|
||||
@@ -126,7 +133,7 @@ export default function JoinCall(props: PageProps) {
|
||||
</div>
|
||||
{displayLogInOverlay && <LogInOverlay isLoggedIn={!!loggedInUserName} bookingUid={booking.uid} />}
|
||||
|
||||
<VideoMeetingInfo booking={booking} />
|
||||
<VideoMeetingInfo booking={booking} rediectAttendeeToOnExit={rediectAttendeeToOnExit} />
|
||||
</DailyProvider>
|
||||
);
|
||||
}
|
||||
@@ -255,16 +262,23 @@ export function LogInOverlay(props: LogInOverlayProps) {
|
||||
|
||||
interface VideoMeetingInfo {
|
||||
booking: PageProps["booking"];
|
||||
rediectAttendeeToOnExit?: string | null;
|
||||
}
|
||||
|
||||
export function VideoMeetingInfo(props: VideoMeetingInfo) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const { booking } = props;
|
||||
const { booking, rediectAttendeeToOnExit } = props;
|
||||
const { t } = useLocale();
|
||||
|
||||
const endTime = new Date(booking.endTime);
|
||||
const startTime = new Date(booking.startTime);
|
||||
|
||||
useDailyEvent("left-meeting", () => {
|
||||
if (rediectAttendeeToOnExit) {
|
||||
window.location.href = rediectAttendeeToOnExit;
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<aside
|
||||
|
||||
Reference in new issue
Block a user