Dashboard: Hide sidebar when playlist is playing (#115414)
This commit is contained in:
@@ -9,6 +9,7 @@ import { ElementSelectionContext, useSidebar, useStyles2, Sidebar } from '@grafa
|
|||||||
import NativeScrollbar, { DivScrollElement } from 'app/core/components/NativeScrollbar';
|
import NativeScrollbar, { DivScrollElement } from 'app/core/components/NativeScrollbar';
|
||||||
import { useGrafana } from 'app/core/context/GrafanaContext';
|
import { useGrafana } from 'app/core/context/GrafanaContext';
|
||||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||||
|
import { playlistSrv } from 'app/features/playlist/PlaylistSrv';
|
||||||
import { KioskMode } from 'app/types/dashboard';
|
import { KioskMode } from 'app/types/dashboard';
|
||||||
|
|
||||||
import { DashboardScene } from '../scene/DashboardScene';
|
import { DashboardScene } from '../scene/DashboardScene';
|
||||||
@@ -32,7 +33,7 @@ export function DashboardEditPaneSplitter({ dashboard, isEditing, body, controls
|
|||||||
const styles = useStyles2(getStyles, headerHeight ?? 0);
|
const styles = useStyles2(getStyles, headerHeight ?? 0);
|
||||||
const { chrome } = useGrafana();
|
const { chrome } = useGrafana();
|
||||||
const { kioskMode } = chrome.useState();
|
const { kioskMode } = chrome.useState();
|
||||||
const isInKioskMode = kioskMode === KioskMode.Full;
|
const { isPlaying } = playlistSrv.useState();
|
||||||
|
|
||||||
if (!config.featureToggles.dashboardNewLayouts) {
|
if (!config.featureToggles.dashboardNewLayouts) {
|
||||||
return (
|
return (
|
||||||
@@ -94,8 +95,10 @@ export function DashboardEditPaneSplitter({ dashboard, isEditing, body, controls
|
|||||||
};
|
};
|
||||||
|
|
||||||
function renderBody() {
|
function renderBody() {
|
||||||
|
const renderWithoutSidebar = isPlaying || kioskMode === KioskMode.Full;
|
||||||
|
|
||||||
// In kiosk mode the full document body scrolls so we don't need to wrap in our own scrollbar
|
// In kiosk mode the full document body scrolls so we don't need to wrap in our own scrollbar
|
||||||
if (isInKioskMode) {
|
if (renderWithoutSidebar) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cx(styles.bodyWrapper, styles.bodyWrapperKiosk)}
|
className={cx(styles.bodyWrapper, styles.bodyWrapperKiosk)}
|
||||||
|
|||||||
Reference in New Issue
Block a user