Skip to content

Commit

Permalink
Font Library: Avoid rendering Font Library UI outside Gutenberg plugin (
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto authored Sep 26, 2023
1 parent 6752a2a commit 1c30e9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ function FontFamilies() {
);
}

export default ( { ...props } ) => (
const FontFamiliesComponent = ( { ...props } ) => (
<FontLibraryProvider>
<FontFamilies { ...props } />
</FontLibraryProvider>
);

export default process.env.IS_GUTENBERG_PLUGIN
? FontFamiliesComponent
: undefined;
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ function ScreenTypography() {
/>
<div className="edit-site-global-styles-screen-typography">
<VStack spacing={ 6 }>
{ ! window.__experimentalDisableFontLibrary && (
<FontFamilies />
) }
{ FontFamilies &&
! window.__experimentalDisableFontLibrary && (
<FontFamilies />
) }
<TypographyElements />
</VStack>
</div>
Expand Down

0 comments on commit 1c30e9d

Please sign in to comment.