Skip to content

Commit

Permalink
Font Library: Show 'Add fonts' button when there are no fonts install…
Browse files Browse the repository at this point in the history
…ed (#58580)

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
  • Loading branch information
noisysocks and ramonjd authored Feb 2, 2024
1 parent 51b732c commit b859f54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/edit-site/src/components/global-styles/font-families.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Button,
Tooltip,
} from '@wordpress/components';
import { typography } from '@wordpress/icons';
import { settings } from '@wordpress/icons';
import { useContext } from '@wordpress/element';

/**
Expand All @@ -33,7 +33,7 @@ function FontFamilies() {
{ !! modalTabOpen && (
<FontLibraryModal
onRequestClose={ () => toggleModal() }
initialTabName={ modalTabOpen }
initialTabId={ modalTabOpen }
/>
) }

Expand All @@ -47,7 +47,7 @@ function FontFamilies() {
toggleModal( 'installed-fonts' )
}
aria-label={ __( 'Manage fonts' ) }
icon={ typography }
icon={ settings }
size={ 'small' }
/>
</Tooltip>
Expand All @@ -63,7 +63,16 @@ function FontFamilies() {
) ) }
</ItemGroup>
) : (
<>{ __( 'No fonts installed.' ) }</>
<>
{ __( 'No fonts installed.' ) }
<Button
className="edit-site-global-styles-font-families__add-fonts"
variant="secondary"
onClick={ () => toggleModal( 'upload-fonts' ) }
>
{ __( 'Add fonts' ) }
</Button>
</>
) }
</VStack>
</>
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
color: $gray-700;
}

.edit-site-global-styles-font-families__add-fonts {
justify-content: center;
}

.edit-site-global-styles-screen-colors {
margin: $grid-unit-20;

Expand Down

0 comments on commit b859f54

Please sign in to comment.