Skip to content

Commit

Permalink
simplify a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jun 23, 2023
1 parent 8401e7a commit 3d1d9cf
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions packages/edit-site/src/components/add-new-template/new-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,16 @@ function TemplateListItem( {
direction,
className,
description,
hideDescription = true,
icon,
onClick,
showTooltip = true,
children,
} ) {
return (
<Button
className={ className }
onClick={ onClick }
label={ description }
showTooltip={ showTooltip }
showTooltip={ !! description }
>
<Flex
as="span"
Expand All @@ -132,13 +131,7 @@ function TemplateListItem( {
>
{ title }
</Text>
{ description && ! hideDescription && (
<Text
lineHeight={ 1.53846153846 } // 20px
>
{ description }
</Text>
) }
{ children }
</VStack>
</Flex>
</Button>
Expand Down Expand Up @@ -335,18 +328,21 @@ export default function NewTemplate( {
title={ __( 'Custom template' ) }
direction="row"
className="edit-site-add-new-template__custom-template-button"
description={ __(
'A custom template can be manually applied to any post or page.'
) }
hideDescription={ false }
showTooltip={ false }
icon={ edit }
onClick={ () =>
setModalContent(
modalContentMap.customGenericTemplate
)
}
/>
>
<Text
lineHeight={ 1.53846153846 } // 20px
>
{ __(
'A custom template can be manually applied to any post or page.'
) }
</Text>
</TemplateListItem>
</Grid>
) }
{ modalContent === modalContentMap.customTemplate && (
Expand Down

0 comments on commit 3d1d9cf

Please sign in to comment.