Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import classnames from 'classnames';
import { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';
import {
__unstableGetAnimateClassName as getAnimateClassName,
withNotices,
ResizableBox,
ToolbarButton,
} from '@wordpress/components';
Expand Down Expand Up @@ -60,14 +59,7 @@ function ClipboardToolbarButton( { text, disabled } ) {
);
}

function FileEdit( {
attributes,
isSelected,
setAttributes,
noticeUI,
noticeOperations,
clientId,
} ) {
function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
const {
id,
fileId,
Expand All @@ -91,6 +83,7 @@ function FileEdit( {
[ id ]
);

const { createErrorNotice } = useDispatch( noticesStore );
const { toggleSelection, __unstableMarkNextChangeAsNotPersistent } =
useDispatch( blockEditorStore );

Expand Down Expand Up @@ -137,8 +130,7 @@ function FileEdit( {

function onUploadError( message ) {
setAttributes( { href: undefined } );
noticeOperations.removeAllNotices();
noticeOperations.createErrorNotice( message );
createErrorNotice( message, { type: 'snackbar' } );
}

function changeLinkDestinationOption( newHref ) {
Expand Down Expand Up @@ -207,7 +199,6 @@ function FileEdit( {
),
} }
onSelect={ onSelectFile }
notices={ noticeUI }
onError={ onUploadError }
accept="*"
/>
Expand Down Expand Up @@ -321,4 +312,4 @@ function FileEdit( {
);
}

export default withNotices( FileEdit );
export default FileEdit;