From 4da77d127c79698d16e959ad6b335942e32bfc5d Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Mon, 18 Dec 2023 14:46:07 -0500 Subject: [PATCH] simplify `name` vs `id` in variables and props --- .../global-styles/font-library-modal/index.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/index.js b/packages/edit-site/src/components/global-styles/font-library-modal/index.js index e3215c7b976954..c8db3722e73d18 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/index.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/index.js @@ -21,18 +21,18 @@ const { Tabs } = unlock( componentsPrivateApis ); const DEFAULT_TABS = [ { - name: 'installed-fonts', + id: 'installed-fonts', title: __( 'Library' ), }, { - name: 'upload-fonts', + id: 'upload-fonts', title: __( 'Upload' ), }, ]; const tabsFromCollections = ( collections ) => collections.map( ( { id, name } ) => ( { - name: id, + id, title: collections.length === 1 && id === 'default-font-collection' ? __( 'Install Fonts' ) @@ -41,7 +41,7 @@ const tabsFromCollections = ( collections ) => function FontLibraryModal( { onRequestClose, - initialTabName = 'installed-fonts', + initialTabId = 'installed-fonts', } ) { const { collections } = useContext( FontLibraryContext ); @@ -58,17 +58,17 @@ function FontLibraryModal( { className="font-library-modal" >
- + - { tabs.map( ( { name, title } ) => ( - + { tabs.map( ( { id, title } ) => ( + { title } ) ) } - { tabs.map( ( { name } ) => { + { tabs.map( ( { id } ) => { let contents; - switch ( name ) { + switch ( id ) { case 'upload-fonts': contents = ; break; @@ -76,12 +76,12 @@ function FontLibraryModal( { contents = ; break; default: - contents = ; + contents = ; } return ( { contents }