Skip to content

Commit

Permalink
fixes from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jan 23, 2024
1 parent 5c1a0c9 commit 9f58d51
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function AuthorField( { item, viewType } ) {
);
}

function Preview( { content, viewType } ) {
function Preview( { item, viewType } ) {
const settings = usePatternSettings();
const [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );
const blocks = useMemo( () => {
Expand Down Expand Up @@ -163,11 +163,11 @@ function Preview( { content, viewType } ) {
onClick={ onClick }
aria-label={ item.title?.rendered || item.title }
>
{ isEmpty ? (
__( 'Empty template' )
) : (
<BlockPreview blocks={ blocks } />
) }
{ isEmpty &&
( item.type === TEMPLATE_POST_TYPE
? __( 'Empty template' )
: __( 'Empty template part' ) ) }
{ ! isEmpty && <BlockPreview blocks={ blocks } /> }
</button>
</div>
</ExperimentalBlockEditorProvider>
Expand Down Expand Up @@ -224,12 +224,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
header: __( 'Preview' ),
id: 'preview',
render: ( { item } ) => {
return (
<Preview
content={ item.content.raw }
viewType={ view.type }
/>
);
return <Preview item={ item } viewType={ view.type } />;
},
minWidth: 120,
maxWidth: 120,
Expand Down

0 comments on commit 9f58d51

Please sign in to comment.