Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { attributes, isSelected, fontSize, setFontSize } = this.props;
const hasMedia = attributes.mediaUrl && attributes.mediaId;
const avatarTooltip = hasMedia ? __( 'Change avatar' ) : __( 'Add avatar' );
const fontSizeClass = getFontSizeClass( attributes.fontSize );
const styles = {
fontSize: fontSizeClass ? undefined : attributes.customFontSize,
};
const className = classnames( this.props.className, {
'has-media': hasMedia || isSelected,
[ `is-aligned-${ attributes.align }` ]: !! attributes.align,
[ fontSizeClass ]: fontSizeClass,
} );
return (
export default ( { attributes, className } ) => {
const { align, content, name, title, mediaUrl, mediaId, fontSize, customFontSize } = attributes;
const hasMedia = mediaUrl && mediaId;
const fontSizeClass = getFontSizeClass( fontSize );
const styles = {
fontSize: fontSizeClass ? undefined : customFontSize,
};
const blockClassName = classnames( className, {
'has-media': hasMedia,
[ `is-aligned-${ align }` ]: !! align,
[ fontSizeClass ]: fontSizeClass,
} );
return (
<div style="{">
</div>