From a7b67290ab4757cb52c27c4706883993a245d9e9 Mon Sep 17 00:00:00 2001 From: tygao Date: Tue, 5 Mar 2024 15:53:00 +0800 Subject: [PATCH] fix: update enum usage Signed-off-by: tygao --- .../public/overlays/sidecar/components/sidecar.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/public/overlays/sidecar/components/sidecar.tsx b/src/core/public/overlays/sidecar/components/sidecar.tsx index af5e5b71b54b..7eec0f666412 100644 --- a/src/core/public/overlays/sidecar/components/sidecar.tsx +++ b/src/core/public/overlays/sidecar/components/sidecar.tsx @@ -12,7 +12,7 @@ import { MountPoint } from '../../../types'; import { MountWrapper } from '../../../utils'; import './sidecar.scss'; import { ResizableButton } from './resizable_button'; -import { ISidecarConfig, OverlaySidecarOpenOptions } from '../sidecar_service'; +import { ISidecarConfig, OverlaySidecarOpenOptions, SIDECAR_DOCKED_MODE } from '../sidecar_service'; export interface Props { sidecarConfig$: BehaviorSubject; @@ -28,9 +28,10 @@ export const Sidecar = ({ sidecarConfig$, options, setSidecarConfig, i18n, mount const classes = classNames( 'osdSidecarFlyout', { - 'osdSidecarFlyout--dockedRight': sidecarConfig?.dockedMode === 'right', - 'osdSidecarFlyout--dockedLeft': sidecarConfig?.dockedMode === 'left', - 'osdSidecarFlyout--dockedTakeover': sidecarConfig?.dockedMode === 'takeover', + 'osdSidecarFlyout--dockedRight': sidecarConfig?.dockedMode === SIDECAR_DOCKED_MODE.RIGHT, + 'osdSidecarFlyout--dockedLeft': sidecarConfig?.dockedMode === SIDECAR_DOCKED_MODE.LEFT, + 'osdSidecarFlyout--dockedTakeover': + sidecarConfig?.dockedMode === SIDECAR_DOCKED_MODE.TAKEOVER, 'osdSidecarFlyout--hide': sidecarConfig?.isHidden === true, }, options.className @@ -46,7 +47,7 @@ export const Sidecar = ({ sidecarConfig$, options, setSidecarConfig, i18n, mount const flyoutSizeStyle = useMemo( () => - sidecarConfig?.dockedMode === 'takeover' + sidecarConfig?.dockedMode === SIDECAR_DOCKED_MODE.TAKEOVER ? { height: sidecarConfig?.paddingSize, }