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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { getBlockAndPreviewFromMedia } from './utils';
import { store as blockEditorStore } from '../../../store';

const ALLOWED_MEDIA_TYPES = [ 'image' ];
const MAXIMUM_TITLE_LENGTH = 25;
const MEDIA_OPTIONS_POPOVER_PROPS = {
position: 'bottom left',
className:
Expand Down Expand Up @@ -239,12 +238,6 @@ export function MediaPreview( { media, onClick, category } ) {
? media.title
: media.title?.rendered || __( 'no title' );

let truncatedTitle;
if ( title.length > MAXIMUM_TITLE_LENGTH ) {
const omission = '...';
truncatedTitle =
title.slice( 0, MAXIMUM_TITLE_LENGTH - omission.length ) + omission;
}
const onMouseEnter = useCallback( () => setIsHovered( true ), [] );
const onMouseLeave = useCallback( () => setIsHovered( false ), [] );
return (
Expand All @@ -268,7 +261,7 @@ export function MediaPreview( { media, onClick, category } ) {
onMouseEnter={ onMouseEnter }
onMouseLeave={ onMouseLeave }
>
<Tooltip text={ truncatedTitle || title }>
<Tooltip text={ title }>
<Composite.Item
render={
<div
Expand Down
Loading