How to use the @wordpress/block-editor.RichText.isEmpty function in @wordpress/block-editor

To help you get started, we’ve selected a few @wordpress/block-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gambitph / Stackable / src / block / image-box / deprecated.js View on Github external
{ /* eslint-disable-next-line */ }
						<a href="{">
						<div>
							{ ! RichText.isEmpty( title ) &amp;&amp; (
								
							) }
							{ ! RichText.isEmpty( description ) &amp;&amp; (
								
							) }
						</div>
						{ arrow &amp;&amp; link &amp;&amp; (
							<div>
								
							</div>
						) }
					
				)
			} ) }</a>
github gambitph / Stackable / src / block / feature / deprecated.js View on Github external
)
	const descriptionComp = ! RichText.isEmpty( description ) &amp;&amp; (
		
	)
	const buttonComp = ! RichText.isEmpty( buttonText ) &amp;&amp; (
		
	)
	const imageComp = imageUrl &amp;&amp; (
github ampproject / amp-wp / assets / src / stories-editor / deprecations / core-blocks / image.js View on Github external
/&gt;
	);

	const figure = (
		&lt;&gt;
			{ href ? (
				<a rel="{" href="{">
					{ image }
				</a>
			) : image }
			{ ! RichText.isEmpty( caption ) &amp;&amp;  }
		
	);

	if ( 'left' === align || 'right' === align || 'center' === align ) {
		return (
			<div>
				<figure>
					{ figure }
				</figure>
			</div>
		);
	}

	return (
		<figure>
			{ figure }</figure>
github gambitph / Stackable / src / block / team-member / deprecated.js View on Github external
[ `ugb--shadow-${ shadow }` ]: design !== 'plain' &amp;&amp; shadow !== 3,
				}, design, i, props ) )

				const styles = applyFilters( 'stackable.team-member.itemstyles_1_17_3', {
					item: {
						borderRadius: design !== 'plain' &amp;&amp; borderRadius !== 12 ? borderRadius : undefined,
					},
				}, design, i, props )

				const imageComp = mediaURL &amp;&amp; (
					<div data-src="{" style="{">
				)
				const nameComp = ! RichText.isEmpty( name ) &amp;&amp; (
					
				)
				const positionComp = ! RichText.isEmpty( position ) &amp;&amp; (
					
				)
				const descriptionComp = ! RichText.isEmpty( description ) &amp;&amp; (</div>
github godaddy-wordpress / coblocks / src / blocks / author / deprecated.js View on Github external
<div>
							{ ! RichText.isEmpty( heading ) &amp;&amp; (
								
							) }
							{ ! RichText.isEmpty( name ) &amp;&amp; (
								
							) }
							{ ! RichText.isEmpty( biography ) &amp;&amp; (
								
							) }
							
						</div>
					
				);
			}
			return null;
		},
	},
github WordPress / gutenberg / packages / block-library / src / video / edit.native.js View on Github external
source={ { uri: src } }
											paused={ true }
											muted={ true }
										/&gt;
									}
									{ ! showVideo &amp;&amp;
										
									}
								
							);
						} }
					/&gt;
					{ ( ! RichText.isEmpty( caption ) &gt; 0 || isSelected ) &amp;&amp; (
						
					) }
				
			
		);
	}
}
github godaddy-wordpress / coblocks / src / blocks / click-to-tweet / deprecated.js View on Github external
color: textColorClass ? undefined : customTextColor,
			};

			const buttonColorClass = getColorClassName( 'background-color', buttonColor );

			const buttonClasses = classnames( 'wp-block-coblocks-click-to-tweet__twitter-btn', {
				'has-button-color': buttonColor || customButtonColor,
				[ buttonColorClass ]: buttonColorClass,
			} );

			const buttonStyles = {
				backgroundColor: buttonColorClass ? undefined : customButtonColor,
			};

			return (
				! RichText.isEmpty( content ) &amp;&amp; (
					<blockquote style="{">
						
						</blockquote>
github Automattic / wp-calypso / apps / full-site-editing / full-site-editing-plugin / blog-posts-block / newspack-homepage-articles / blocks / homepage-articles / edit.js View on Github external
title: __( 'Uncropped', 'newspack-blocks' ),
				isActive: imageShape === 'uncropped',
				onClick: () =&gt; setAttributes( { imageShape: 'uncropped' } ),
			},
		];

		return (
			
				<div style="{">
					<div>
						{ latestPosts &amp;&amp; ( ! RichText.isEmpty( sectionHeader ) || isSelected ) &amp;&amp; (
							 setAttributes( { sectionHeader: value } ) }
								placeholder={ __( 'Write header…', 'newspack-blocks' ) }
								value={ sectionHeader }
								tagName="h2"
								className="article-section-title"
							/&gt;
						) }
						{ latestPosts &amp;&amp; ! latestPosts.length &amp;&amp; (
							{ __( 'Sorry, no posts were found.', 'newspack-blocks' ) }
						) }
						{ ! latestPosts &amp;&amp; (
							
								
							
						) }</div></div>
github gambitph / Stackable / src / block / header / save.js View on Github external
[ `ugb--shadow-${ shadow }` ]: show.columnBackground &amp;&amp; shadow !== '',
	}, props ) )

	const titleComp = showTitle &amp;&amp; ! RichText.isEmpty( title ) &amp;&amp;
		
	const subtitleComp = showSubtitle &amp;&amp; ! RichText.isEmpty( subtitle ) &amp;&amp;
		
	const buttonComp = showButton &amp;&amp; ! RichText.isEmpty( buttonText ) &amp;&amp;
		
	const button2Comp = showButton2 &amp;&amp; //! RichText.isEmpty( button2Text ) &amp;&amp;
		

	const comps = {
		titleComp,
		subtitleComp,
		buttonComp,
github gambitph / Stackable / src / block / pricing-box / save.js View on Github external
const imageComp = imageUrl &amp;&amp;
						<div>
							<img shape="{" title="" alt="{" src="{">
						</div>
					const imageBgComp = imageUrl &amp;&amp;
						<div></div>

					const titleComp = ! RichText.isEmpty( title ) &amp;&amp; (
						
					)
					const priceComp = ! RichText.isEmpty( price ) &amp;&amp; (
						<div>
							{ ! RichText.isEmpty( price ) &amp;&amp; (
								<div>
									{ showPricePrefix &amp;&amp; ! RichText.isEmpty( pricePrefix ) &amp;&amp; (
										</div></div>