From 0dd464559a18cd8efaf08549fe58dddf7016cd9f Mon Sep 17 00:00:00 2001 From: Naerriel Date: Fri, 8 Feb 2019 18:07:33 +0100 Subject: [PATCH] Stop displaying font-size-picker when there are no fonts. --- .../components/src/font-size-picker/index.js | 82 ++++++++++--------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/packages/components/src/font-size-picker/index.js b/packages/components/src/font-size-picker/index.js index 2908b3879c1ebf..2e7877cf20613e 100644 --- a/packages/components/src/font-size-picker/index.js +++ b/packages/components/src/font-size-picker/index.js @@ -41,47 +41,49 @@ function FontSizePicker( { return (
- ( - - ) } - renderContent={ () => ( - - { map( fontSizes, ( { name, size, slug } ) => { - const isSelected = ( value === size || ( ! value && slug === 'normal' ) ); + { ( fontSizes.length > 0 ) && + ( + + ) } + renderContent={ () => ( + + { map( fontSizes, ( { name, size, slug } ) => { + const isSelected = ( value === size || ( ! value && slug === 'normal' ) ); - return ( - - ); - } ) } - - ) } - /> + return ( + + ); + } ) } + + ) } + /> + } { ( ! withSlider && ! disableCustomFontSizes ) &&