: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import React from 'react';
import * as WpBlocksApi from '@wordpress/blocks';
import CalendarIcon from '../Common/CalendarIcon';
import { connectionStatus } from '../../constants/leadinConfig';
import MeetingGutenbergPreview from './MeetingGutenbergPreview';
import MeetingSaveBlock from './MeetingSaveBlock';
import MeetingEdit from '../../shared/Meeting/MeetingEdit';
import ErrorHandler from '../../shared/Common/ErrorHandler';
import { __ } from '@wordpress/i18n';
import { isFullSiteEditor } from '../../utils/withMetaData';
const ConnectionStatus = {
NotConnected: 'NotConnected',
export interface IMeetingBlockAttributes {
export interface IMeetingBlockProps extends IMeetingBlockAttributes {
export default function registerMeetingBlock() {
const editComponent = (props: IMeetingBlockProps) => {
if (props.attributes.preview) {
return <MeetingGutenbergPreview />;
} else if (connectionStatus === ConnectionStatus.Connected) {
return <MeetingEdit {...props} preview={true} origin="gutenberg" />;
return <ErrorHandler status={401} />;
// We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
if (!WpBlocksApi || isFullSiteEditor()) {
WpBlocksApi.registerBlockType('leadin/hubspot-meeting-block', {
title: __('Hubspot Meetings Scheduler', 'leadin'),
'Schedule meetings faster and forget the back-and-forth emails Your calendar stays full, and you stay productive',
category: 'leadin-blocks',
} as WpBlocksApi.BlockAttribute<string>,
} as WpBlocksApi.BlockAttribute<boolean>,
save: props => <MeetingSaveBlock {...props} />,