Skip to content
Closed
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 @@ -164,7 +164,8 @@ function NewTemplateModal( { onClose } ) {
const { createErrorNotice, createSuccessNotice } =
useDispatch( noticesStore );
const containerRef = useRef( null );
const isMobile = useViewportMatch( 'medium', '<' );
const isMedium = useViewportMatch( 'medium', '<' );
const isMobile = useViewportMatch( 'mobile', '<' );

const homeUrl = useSelect( ( select ) => {
// Site index.
Expand Down Expand Up @@ -261,7 +262,10 @@ function NewTemplateModal( { onClose } ) {
} else if ( modalContent === modalContentMap.customGenericTemplate ) {
modalTitle = __( 'Create custom template' );
}

let gridColumns = 3;
if ( isMobile || isMedium ) {
gridColumns = isMobile ? 1 : 2;
}
return (
<Modal
title={ modalTitle }
Expand All @@ -281,7 +285,7 @@ function NewTemplateModal( { onClose } ) {
>
{ modalContent === modalContentMap.templatesList && (
<Grid
columns={ isMobile ? 2 : 3 }
columns={ gridColumns }
gap={ 4 }
align="flex-start"
justify="center"
Expand Down
Loading