Skip to content

Commit

Permalink
We don't need useSettingsForBlockElement() yet because we're not deal…
Browse files Browse the repository at this point in the history
…ing with blocks. I think that's the way it works.

We don't need useSettingsForBlockElement() yet because we're not dealing with blocks. I think that's the way it works.
  • Loading branch information
ramonjd committed Mar 1, 2024
1 parent 1ed8dd0 commit 384d0bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { unlock } from '../../lock-unlock';
const {
useGlobalStyle,
useGlobalSetting,
useSettingsForBlockElement,
BackgroundPanel: StylesBackgroundPanel,
} = unlock( blockEditorPrivateApis );

Expand All @@ -22,9 +21,7 @@ export default function BackgroundPanel() {
const [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {
shouldDecodeEncode: false,
} );

const [ rawSettings ] = useGlobalSetting( '' );
const settings = useSettingsForBlockElement( rawSettings );
const [ settings ] = useGlobalSetting( '' );

return (
<StylesBackgroundPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import BackgroundPanel from './background-panel';
import ScreenHeader from './header';
import { unlock } from '../../lock-unlock';

const { useHasBackgroundPanel, useGlobalSetting, useSettingsForBlockElement } =
unlock( blockEditorPrivateApis );
const { useHasBackgroundPanel, useGlobalSetting } = unlock(
blockEditorPrivateApis
);

function ScreenBackground() {
const [ rawSettings ] = useGlobalSetting( '' );
const settings = useSettingsForBlockElement( rawSettings );
const [ settings ] = useGlobalSetting( '' );
const hasBackgroundPanel = useHasBackgroundPanel( settings );
return (
<>
Expand Down

0 comments on commit 384d0bc

Please sign in to comment.