From 1e980e97ead3608cb97492212d51d4f40d2be5ef Mon Sep 17 00:00:00 2001 From: inc2734 Date: Wed, 6 Dec 2023 23:28:05 +0900 Subject: [PATCH 1/4] #56734 When there is no font, the border should not appear. Display further guidance text. --- .../components/global-styles/font-families.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index 06bf5953283323..fcbb37fa5fab4e 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -51,14 +51,22 @@ function FontFamilies() { - - { customFonts.map( ( font ) => ( - - ) ) } - { themeFonts.map( ( font ) => ( - - ) ) } - + { 0 < customFonts.length || 0 < themeFonts.length ? ( + + { customFonts.map( ( font ) => ( + + ) ) } + { themeFonts.map( ( font ) => ( + + ) ) } + + ) : ( + <> + { __( + 'Fonts are empty! Add some fonts and apply them to your site' + ) } + + ) } ); From f62b4acfc178dcff21a0efc3d9c3cfc09df14b1b Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Wed, 3 Jan 2024 09:04:54 -0600 Subject: [PATCH 2/4] update text --- .../edit-site/src/components/global-styles/font-families.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index fcbb37fa5fab4e..5ad46548610159 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -63,7 +63,7 @@ function FontFamilies() { ) : ( <> { __( - 'Fonts are empty! Add some fonts and apply them to your site' + 'No fonts installed.' ) } ) } From 74209cef724374913cfced8d639192dee8a1fb9e Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 11 Jan 2024 14:47:03 +0000 Subject: [PATCH 3/4] Fix formatting in font-families.js --- .../edit-site/src/components/global-styles/font-families.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index 5ad46548610159..970c9feb4fdcbd 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -61,11 +61,7 @@ function FontFamilies() { ) ) } ) : ( - <> - { __( - 'No fonts installed.' - ) } - + <>{ __( 'No fonts installed.' ) } ) } From fa96f0f4317e316a947dfe4e11acd6d0100b6487 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 11 Jan 2024 14:53:53 +0000 Subject: [PATCH 4/4] Improve readability --- .../edit-site/src/components/global-styles/font-families.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/global-styles/font-families.js b/packages/edit-site/src/components/global-styles/font-families.js index 970c9feb4fdcbd..7a7597878eacd1 100644 --- a/packages/edit-site/src/components/global-styles/font-families.js +++ b/packages/edit-site/src/components/global-styles/font-families.js @@ -26,6 +26,8 @@ function FontFamilies() { const { modalTabOpen, toggleModal, themeFonts, customFonts } = useContext( FontLibraryContext ); + const hasFonts = 0 < customFonts.length || 0 < themeFonts.length; + return ( <> { !! modalTabOpen && ( @@ -51,7 +53,7 @@ function FontFamilies() { - { 0 < customFonts.length || 0 < themeFonts.length ? ( + { hasFonts ? ( { customFonts.map( ( font ) => (