Add default CSS if workpad CSS is missing in Canvas (#109961) (#117390)

This commit is contained in:
Poff Poffenberger 2021-11-03 14:46:22 -05:00 committed by GitHub
parent a9144b98a5
commit c92257d08d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,11 @@ import Style from 'style-it';
// @ts-expect-error
import { WorkpadPage } from '../workpad_page';
import { Fullscreen } from '../fullscreen';
import { HEADER_BANNER_HEIGHT, WORKPAD_CANVAS_BUFFER } from '../../../common/lib/constants';
import {
HEADER_BANNER_HEIGHT,
WORKPAD_CANVAS_BUFFER,
DEFAULT_WORKPAD_CSS,
} from '../../../common/lib/constants';
import { CommitFn, CanvasPage } from '../../../types';
import { WorkpadShortcuts } from './workpad_shortcuts.component';
@ -122,7 +126,7 @@ export const Workpad: FC<Props> = ({
// NOTE: the data-shared-* attributes here are used for reporting
return Style.it(
workpadCss,
workpadCss || DEFAULT_WORKPAD_CSS,
<div
className={`canvasWorkpad ${isFullscreenProp ? 'fullscreen' : ''}`}
style={fsStyle}