Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#56734 When there is no font, the border should not appear. Display further guidance text. #56825

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions packages/edit-site/src/components/global-styles/font-families.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function FontFamilies() {
const { modalTabOpen, toggleModal, themeFonts, customFonts } =
useContext( FontLibraryContext );

const hasFonts = 0 < customFonts.length || 0 < themeFonts.length;

return (
<>
{ !! modalTabOpen && (
Expand All @@ -51,14 +53,18 @@ function FontFamilies() {
</Tooltip>
</HStack>
</HStack>
<ItemGroup isBordered isSeparated>
{ customFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
{ themeFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
</ItemGroup>
{ hasFonts ? (
<ItemGroup isBordered isSeparated>
{ customFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
{ themeFonts.map( ( font ) => (
<FontFamilyItem key={ font.slug } font={ font } />
) ) }
</ItemGroup>
) : (
<>{ __( 'No fonts installed.' ) }</>
) }
</VStack>
</>
);
Expand Down
Loading