Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/leadin/scripts/gutenber.../Meetings...
File: registerMeetingBlock.tsx
import React from 'react';
[0] Fix | Delete
import * as WpBlocksApi from '@wordpress/blocks';
[1] Fix | Delete
import CalendarIcon from '../Common/CalendarIcon';
[2] Fix | Delete
import { connectionStatus } from '../../constants/leadinConfig';
[3] Fix | Delete
import MeetingGutenbergPreview from './MeetingGutenbergPreview';
[4] Fix | Delete
import MeetingSaveBlock from './MeetingSaveBlock';
[5] Fix | Delete
import MeetingEdit from '../../shared/Meeting/MeetingEdit';
[6] Fix | Delete
import ErrorHandler from '../../shared/Common/ErrorHandler';
[7] Fix | Delete
import { __ } from '@wordpress/i18n';
[8] Fix | Delete
import { isFullSiteEditor } from '../../utils/withMetaData';
[9] Fix | Delete
[10] Fix | Delete
const ConnectionStatus = {
[11] Fix | Delete
Connected: 'Connected',
[12] Fix | Delete
NotConnected: 'NotConnected',
[13] Fix | Delete
};
[14] Fix | Delete
[15] Fix | Delete
export interface IMeetingBlockAttributes {
[16] Fix | Delete
attributes: {
[17] Fix | Delete
url: string;
[18] Fix | Delete
preview?: boolean;
[19] Fix | Delete
};
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
export interface IMeetingBlockProps extends IMeetingBlockAttributes {
[23] Fix | Delete
setAttributes: Function;
[24] Fix | Delete
isSelected: boolean;
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
export default function registerMeetingBlock() {
[28] Fix | Delete
const editComponent = (props: IMeetingBlockProps) => {
[29] Fix | Delete
if (props.attributes.preview) {
[30] Fix | Delete
return <MeetingGutenbergPreview />;
[31] Fix | Delete
} else if (connectionStatus === ConnectionStatus.Connected) {
[32] Fix | Delete
return <MeetingEdit {...props} preview={true} origin="gutenberg" />;
[33] Fix | Delete
} else {
[34] Fix | Delete
return <ErrorHandler status={401} />;
[35] Fix | Delete
}
[36] Fix | Delete
};
[37] Fix | Delete
[38] Fix | Delete
// We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
[39] Fix | Delete
if (!WpBlocksApi || isFullSiteEditor()) {
[40] Fix | Delete
return null;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
WpBlocksApi.registerBlockType('leadin/hubspot-meeting-block', {
[44] Fix | Delete
title: __('Hubspot Meetings Scheduler', 'leadin'),
[45] Fix | Delete
description: __(
[46] Fix | Delete
'Schedule meetings faster and forget the back-and-forth emails Your calendar stays full, and you stay productive',
[47] Fix | Delete
'leadin'
[48] Fix | Delete
),
[49] Fix | Delete
icon: CalendarIcon,
[50] Fix | Delete
category: 'leadin-blocks',
[51] Fix | Delete
attributes: {
[52] Fix | Delete
url: {
[53] Fix | Delete
type: 'string',
[54] Fix | Delete
default: '',
[55] Fix | Delete
} as WpBlocksApi.BlockAttribute<string>,
[56] Fix | Delete
preview: {
[57] Fix | Delete
type: 'boolean',
[58] Fix | Delete
default: false,
[59] Fix | Delete
} as WpBlocksApi.BlockAttribute<boolean>,
[60] Fix | Delete
},
[61] Fix | Delete
example: {
[62] Fix | Delete
attributes: {
[63] Fix | Delete
preview: true,
[64] Fix | Delete
},
[65] Fix | Delete
},
[66] Fix | Delete
edit: editComponent,
[67] Fix | Delete
save: props => <MeetingSaveBlock {...props} />,
[68] Fix | Delete
});
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function