UNPKG

@atlaskit/page-layout

Version:

A collection of components which let you compose an application's page layout.

54 lines (52 loc) 2 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; /** * @jsxRuntime classic * @jsx jsx */ import { useEffect } from 'react'; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports import { jsx } from '@emotion/react'; import { VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants'; import { resolveDimension } from '../../common/resolve-dimension'; import { publishGridState, useSkipLink } from '../../controllers'; import LeftSidebarInner from './internal/left-sidebar-inner'; import LeftSidebarOuter from './internal/left-sidebar-outer'; import SlotDimensions from './slot-dimensions'; /** * __Left sidebar without resize__ * * Provides a slot for a left sidebar without resize within the PageLayout. * * - [Examples](https://atlassian.design/components/page-layout/examples) * - [Code](https://atlassian.design/components/page-layout/code) * * @deprecated `@atlaskit/page-layout` is deprecated. Use `@atlaskit/navigation-system` instead. */ var LeftSidebarWithoutResize = function LeftSidebarWithoutResize(props) { var children = props.children, id = props.id, width = props.width, isFixed = props.isFixed, shouldPersistWidth = props.shouldPersistWidth, testId = props.testId, skipLinkTitle = props.skipLinkTitle; var leftSidebarWidth = resolveDimension(VAR_LEFT_SIDEBAR_WIDTH, width, shouldPersistWidth); useEffect(function () { publishGridState(_defineProperty({}, VAR_LEFT_SIDEBAR_WIDTH, leftSidebarWidth)); return function () { publishGridState(_defineProperty({}, VAR_LEFT_SIDEBAR_WIDTH, 0)); }; }, [leftSidebarWidth]); useSkipLink(id, skipLinkTitle); return jsx(LeftSidebarOuter, { id: id, testId: testId, isFixed: isFixed }, jsx(SlotDimensions, { variableName: VAR_LEFT_SIDEBAR_WIDTH, value: leftSidebarWidth }), jsx(LeftSidebarInner, { isFixed: isFixed }, children)); }; export default LeftSidebarWithoutResize;