PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.65
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.65
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / scripts / shared / Meeting / PreviewMeeting.tsx

PreviewMeeting.tsx in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.3.65, at scripts/shared/Meeting/PreviewMeeting.tsx

37 lines 887 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React, { Fragment, useEffect, useRef } from 'react';
2 import UIOverlay from '../UIComponents/UIOverlay';
3 import PreviewDisabled from '../Common/PreviewDisabled';
4
5 interface IPreviewForm {
6 url: string;
7 fullSiteEditor?: boolean;
8 }
9
10 export default function PreviewForm({ url, fullSiteEditor }: IPreviewForm) {
11 const inputEl = useRef<HTMLDivElement>(null);
12
13 useEffect(() => {
14 if (inputEl.current) {
15 //@ts-expect-error Hubspot global
16 const hbspt = window.parent.hbspt || window.hbspt;
17 hbspt.meetings.create('.meetings-iframe-container');
18 }
19 }, [url, inputEl]);
20
21 if (fullSiteEditor) {
22 return <PreviewDisabled />;
23 }
24
25 return (
26 <Fragment>
27 {url && (
28 <UIOverlay
29 ref={inputEl}
30 className="meetings-iframe-container"
31 data-src={`${url}?embed=true`}
32 ></UIOverlay>
33 )}
34 </Fragment>
35 );
36 }
37