From afb02a88288460acc32389110a6188790ce7810e Mon Sep 17 00:00:00 2001 From: Serhiy Zakharchenko Date: Wed, 16 Oct 2024 20:26:26 +0100 Subject: [PATCH] Open sidebar fix --- assets/admin/css/admin.css | 2 +- assets/admin/scss/_episode-meta-sidebar.scss | 2 +- src/components/EpisodeMetaSidebar.js | 2 +- src/components/SSPSidebarPanel.js | 14 ++++++++------ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assets/admin/css/admin.css b/assets/admin/css/admin.css index 58a21c0b..249a1268 100644 --- a/assets/admin/css/admin.css +++ b/assets/admin/css/admin.css @@ -1131,7 +1131,7 @@ textarea#episode_embed_code { .ssp-post-publish__btn a:hover { background: #eff0f0; } -#ssp-episode-meta-sidebar\:ssp-sidebar .interface-complementary-area-header__title { +#ssp-episode-meta-sidebar\:ssp-episode-meta-sidebar .interface-complementary-area-header__title { font-size: 12px; } .ssp-episode-meta-sidebar .ssp-accordion, .ssp-sidebar-panel .ssp-accordion { diff --git a/assets/admin/scss/_episode-meta-sidebar.scss b/assets/admin/scss/_episode-meta-sidebar.scss index a7ef31ea..6b751193 100644 --- a/assets/admin/scss/_episode-meta-sidebar.scss +++ b/assets/admin/scss/_episode-meta-sidebar.scss @@ -1,4 +1,4 @@ -#ssp-episode-meta-sidebar\:ssp-sidebar { +#ssp-episode-meta-sidebar\:ssp-episode-meta-sidebar { .interface-complementary-area-header__title { font-size: 12px; } diff --git a/src/components/EpisodeMetaSidebar.js b/src/components/EpisodeMetaSidebar.js index 5ee50bce..5b3a370f 100644 --- a/src/components/EpisodeMetaSidebar.js +++ b/src/components/EpisodeMetaSidebar.js @@ -146,7 +146,7 @@ const EpisodeMetaSidebar = () => { return ( } diff --git a/src/components/SSPSidebarPanel.js b/src/components/SSPSidebarPanel.js index 1fcc9281..9be6d0ed 100644 --- a/src/components/SSPSidebarPanel.js +++ b/src/components/SSPSidebarPanel.js @@ -1,11 +1,11 @@ import { PluginPostStatusInfo } from '@wordpress/edit-post'; -import { useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; import classnames from 'classnames'; import { useState } from '@wordpress/element'; import { Button } from '@wordpress/components'; import FileIsUploadedSvg from '../img/file-is-uploaded.svg'; import FileNotUploadedSvg from '../img/file-not-uploaded.svg'; +import { useDispatch, useSelect } from '@wordpress/data'; const SSPSidebarPanel = () => { const editor = useSelect(( select ) => select('core/editor')); @@ -17,6 +17,12 @@ const SSPSidebarPanel = () => { const postMeta = editor.getEditedPostAttribute('meta'); const fileIsUploaded = !! postMeta.audio_file; + const { openGeneralSidebar } = useDispatch('core/edit-post'); + + const openSSPSidebar = () => { + openGeneralSidebar('ssp-episode-meta-sidebar/ssp-episode-meta-sidebar'); // Sidebar slug + }; + return (
@@ -54,11 +60,7 @@ const SSPSidebarPanel = () => {