-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Font Library: Make notices more consistent #58180
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c8072d4
Font Library: add wp_font_face post type and scaffold font face REST …
creativecoder 61da35c
Font Library: create font faces through the REST API (#57702)
creativecoder 42565a3
Refactor Font Family Controller (#57785)
creativecoder afacdf2
Font Family and Font Face REST API endpoints: better data handling an…
creativecoder 7c82cb9
Font Families REST API endpoint: ensure unique font family slugs (#57…
creativecoder f84cc6d
Font Library: delete child font faces and font assets when deleting p…
creativecoder 492a3ee
Font Library: refactor client side install functions to work with rev…
jffng 9ebc25f
Cleanup/font library view error handling (#57926)
pbking 8a5efd4
Font Faces endpoint: prevent creating font faces with duplicate setti…
creativecoder 3a739bc
Font Library: Update uninstall/delete on client side (#57932)
mikachan c6e0fbb
Update packages/edit-site/src/components/global-styles/font-library-m…
mikachan 74be330
Merge branch 'trunk' into try/font-library-refactor
mikachan a666bb5
Font Library: address JS feedback in #57688 (#57961)
mikachan 1aa3b0c
Add missing dep in font-demo
mikachan 0d92b6f
Move notice to top of local-fonts panel
mikachan 2502ebf
Add container around spinner
mikachan 552842b
Move notice to TabPanelLayout
mikachan cc8e4f8
Remove spacer from LocalFonts
mikachan c4bef05
Move notice and setNotice state to context.js
mikachan 524972f
Move spacer outside of notice container
mikachan e9d29d9
Merge branch 'trunk' into font-library/ui-tweaks
mikachan 049e5a5
Rename LocalFonts to UploadFonts
mikachan c323c44
Make notices dismissible
mikachan 92fea20
Reset notices onRemove
mikachan 2bf44c2
Reset notice when new tab is selected
mikachan e7fb1e8
Reset notice on each action
mikachan 7e94ee8
Merge branch 'trunk' into font-library/update-notices
mikachan 4750131
Merge branch 'trunk' into font-library/update-notices
mikachan 9705a48
Fix notice re-render on fetchFontCollection
mikachan ccf7f40
Move notices below font collection title and description
mikachan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ function FontFaceDemo( { customPreviewUrl, fontFace, text, style = {} } ) { | |
} | ||
}; | ||
loadAsset(); | ||
}, [ fontFace, isIntersecting, loadFontFaceAsset ] ); | ||
}, [ fontFace, isIntersecting, loadFontFaceAsset, isPreviewImage ] ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated, I just noticed it needed updating. |
||
|
||
return ( | ||
<div ref={ ref }> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to check for notice? I think we could remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this as the
fetchFontCollection
function keeps re-setting the notice on failure if there is an error with the font collection (e.g. something wrong with the JSON file), and it was causing an infinite loop of setting the error notice, I think becausesetNotice
is a dependency of theuseEffect
where this function is called, so the notice was causing a re-render. This line fixed the issue (original discussion here). (This is happening on trunk, so I guess this isn't 100% related to this PR.)