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 May 29, 2024
1 parent b3188ed commit 6964b73
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
50 changes: 24 additions & 26 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,8 @@ import { __ } from '@wordpress/i18n';
import {
__experimentalItemGroup as ItemGroup,
__experimentalVStack as VStack,
__experimentalHStack as HStack,
Button,
Tooltip,
} from '@wordpress/components';
import { settings } from '@wordpress/icons';
import { useContext } from '@wordpress/element';

/**
Expand Down Expand Up @@ -38,30 +35,31 @@ function FontFamilies() {
) }

<VStack spacing={ 2 }>
<HStack justify="space-between">
<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
<HStack justify="flex-end">
<Tooltip text={ __( 'Manage fonts' ) }>
<Button
onClick={ () =>
toggleModal( 'installed-fonts' )
}
aria-label={ __( 'Manage fonts' ) }
icon={ settings }
size={ 'small' }
/>
</Tooltip>
</HStack>
</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={ () => toggleModal( '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 6964b73

Please sign in to comment.