@@ -8,9 +8,18 @@ import classnames from 'classnames';
88/**
99 * Internal dependencies
1010 */
11- import { Card , CardFooter , CardMedia , Icon } from '@wordpress/components' ;
11+ import {
12+ Card as CardComponent ,
13+ CardFooter as CardFooterComponent ,
14+ CardMedia as CardMediaComponent ,
15+ Icon ,
16+ } from '@wordpress/components' ;
1217import { removeQueryArgs } from '@wordpress/url' ;
1318
19+ const Card = CardComponent . withComponent ( 'button' ) ;
20+ const CardFooter = CardFooterComponent . withComponent ( 'span' ) ;
21+ const CardMedia = CardMediaComponent . withComponent ( 'span' ) ;
22+
1423type Template = import ( '@automattic/data-stores' ) . VerticalsTemplates . Template ;
1524
1625interface Props {
@@ -36,7 +45,6 @@ const PageLayoutSelector: FunctionComponent< Props > = ( {
3645 < div className = "page-layout-selector__grid" >
3746 { templates . map ( template => (
3847 < Card
39- as = "button"
4048 className = { classnames ( 'page-layout-selector__item' , {
4149 'is-selected' : selectedLayouts . has ( template . slug ) ,
4250 } ) }
@@ -46,10 +54,10 @@ const PageLayoutSelector: FunctionComponent< Props > = ( {
4654 < span className = "page-layout-selector__selected-indicator" >
4755 < Icon icon = "yes" size = { 24 } />
4856 </ span >
49- < CardMedia className = "page-layout-selector__card-media" as = "span" >
57+ < CardMedia className = "page-layout-selector__card-media" >
5058 < img alt = { template . description } src = { removeQueryArgs ( template . preview , 'w' ) } />
5159 </ CardMedia >
52- < CardFooter className = "page-layout-selector__card-footer" as = "span" >
60+ < CardFooter className = "page-layout-selector__card-footer" >
5361 { template . title }
5462 </ CardFooter >
5563 </ Card >
0 commit comments