Skip to content

Commit

Permalink
remove preview image when adding block
Browse files Browse the repository at this point in the history
since we're setting the default value of preview to true, we can't return return the placeholder image early since it prevents the edit controls from rendering
  • Loading branch information
psorensen committed Feb 6, 2024
1 parent 9809e7f commit 01198cf
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ function Edit( props ) {
const { currentSkin, preview } = attributes;
const [ useCustomUrl, setUseCustomUrl ] = useState( false );

if ( preview && previewImg ) {
return (
<>
<img
src={ previewImg }
alt={ __( 'Winamp Player', 'winamp-block' ) }
/>
</>
);
}

const blockProps = useBlockProps(); // eslint-disable-line react-hooks/rules-of-hooks
const { replaceInnerBlocks } = useDispatch( blockEditorStore ); // eslint-disable-line react-hooks/rules-of-hooks

Expand Down

0 comments on commit 01198cf

Please sign in to comment.