@atlaskit/side-navigation
Version:
A highly composable side navigation component that supports nested views.
32 lines (30 loc) • 1.13 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import React, { forwardRef } from 'react';
import MenuSection from '@atlaskit/menu/section';
import { useShouldNestedElementRender } from '../NestableNavigationContent/use-should-nested-element-render';
/**
* @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
*/
/**
* __Section__
*
* Used to separate items into sections. Using the title prop makes a section
* implicitly group the items for screen readers with no additional work required.
*
* - [Examples](https://atlassian.design/components/side-navigation/examples#section)
* - [Code](https://atlassian.design/components/side-navigation/code)
*
* @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
*/
export const Section = /*#__PURE__*/forwardRef((props, ref) => {
const {
shouldRender
} = useShouldNestedElementRender();
if (!shouldRender) {
return props.children;
}
return /*#__PURE__*/React.createElement(MenuSection, _extends({}, props, {
ref: ref,
isSideNavSection: true
}));
});