Skip to content

Commit

Permalink
Replace Manage fonts icon button with visible text button.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Jun 5, 2024
1 parent eaf2d65 commit 44e2147
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
45 changes: 27 additions & 18 deletions packages/edit-site/src/components/global-styles/font-families.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { __ } from '@wordpress/i18n';
import {
__experimentalItemGroup as ItemGroup,
__experimentalVStack as VStack,
__experimentalHStack as HStack,
Button,
} from '@wordpress/components';
<<<<<<< HEAD
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { settings } from '@wordpress/icons';
=======
>>>>>>> 72a59c77a0 (Replace Manage fonts icon button with visible text button.)
import { useContext } from '@wordpress/element';

/**
Expand Down Expand Up @@ -51,24 +53,31 @@ function FontFamilies() {
) }

<VStack spacing={ 2 }>
<HStack justify="space-between">
<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
<Button
onClick={ () => setModalTabOpen( 'installed-fonts' ) }
label={ __( 'Manage fonts' ) }
icon={ settings }
size="small"
/>
</HStack>
<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
{ hasFonts ? (
<ItemGroup isBordered isSeparated>
{ customFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
{ themeFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
</ItemGroup>
<>
<ItemGroup isBordered isSeparated>
{ customFonts.map( ( font ) => (
<FontFamilyItem
key={ font.slug }
font={ font }
/>
) ) }
{ themeFonts.map( ( font ) => (
<FontFamilyItem
key={ font.slug }
font={ font }
/>
) ) }
</ItemGroup>
<Button
className="edit-site-global-styles-font-families__manage-fonts"
variant="secondary"
onClick={ () => setModalTabOpen( 'installed-fonts' ) }
>
{ __( 'Manage fonts' ) }
</Button>
</>
) : (
<>
{ __( 'No fonts installed.' ) }
Expand Down
3 changes: 2 additions & 1 deletion packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
color: $gray-700;
}

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

Expand Down

0 comments on commit 44e2147

Please sign in to comment.