Conversation
|
Size Change: 0 B Total Size: 1.04 MB ℹ️ View Unchanged
|
| }; | ||
|
|
||
| export default memo( EmbedPreview ); | ||
| export default memo( withPreferredColorScheme( EmbedPreview ) ); |
There was a problem hiding this comment.
Seems like we're only using withPreferredColorScheme to get and pass down preferredColorScheme to SandBox. Maybe we can instead use usePreferredColorSchemeStyle hook in SandBox component directly?
There was a problem hiding this comment.
Yeah although the usePreferredColorSchemeStyle hook is meant to be used for picking the right style depending on the light/dark mode status. In this case, I'd rather use usePreferredColorScheme that returns the color scheme instead 😃 .
There was a problem hiding this comment.
Do you think it would be possible/better to use the hook directly in SandBox and not make any changes in EmbedPreview component?
There was a problem hiding this comment.
Yeah, I initially thought to add it there but since SandBox is a generic component I wanted to leave the color scheme calculation open to the parent. However, I agree that looks cleaner to have the hook directly there.
There was a problem hiding this comment.
@ceyhun I applied your suggestion in this commit. I also updated the branch with the last changes from trunk and solve conflicts, the PR is ready for another review 🙇 .
|
@ceyhun I've applied the suggestion from your comment, so the PR is ready for another review 🎊 . |
# Conflicts: # packages/block-library/src/embed/embed-preview.native.js # packages/components/src/sandbox/index.native.js
Additionally I added a a missing entry related to the WP embed component implementation.
| --> | ||
|
|
||
| ## Unreleased | ||
| - [**] [Embed block] Implement WP embed preview component [#34004] |
There was a problem hiding this comment.
I added the entry for the WP embed preview component implementation because it was missing.
* trunk: [RNMobile][Embed block] Add device's locale to preview content (#33858) Update AlignmentMatrixControl docs post merge. (#34662) Chore: Update caniuse package to the latest version (#34685) Chore: Move `react-native-url-polyfill` to dev dependencies (#34687) Site Editor - add basic plugin support (#34460) ESLint Plugin: Use Jest related rules only when the package is installed (#33120) Update `@wordpress/components` package's contributing guidelines (#33960) chore(release): publish Update changelog files [RNMobile] [Embed block] Fix content disappearing on Android when switching light/dark mode (#34207) Scripts: Convert legacy entry point arguments for compatibility with webpack 5 (#34264) Update justication control in `flex` layout (#34651) Block Editor: Rename experimental prop used in `BlockControls` (#34644) Fix social links deprecation (#34639)
gutenberg-mobilePR: wordpress-mobile/gutenberg-mobile#3859Description
As it was done for the device rotation action, I'm adding to prop
keyof the SandBox component the value of the light/dark mode, this way when this device setting changes it will recreate the WebView to prevent the content from disappearing.How has this been tested?
Screenshots
N/A
Types of changes
Bug fix
Checklist:
*.native.jsfiles for terms that need renaming or removal).