UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

43 lines (40 loc) • 1.52 kB
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import "./index.compiled.css"; import { ax, ix } from "@compiled/react/runtime"; import React from 'react'; import ExitingPersistence from '@atlaskit/motion/exiting-persistence'; import FadeIn from '@atlaskit/motion/fade-in'; import { useShouldNestedElementRender } from '../NestableNavigationContent/use-should-nested-element-render'; /** * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ const baseMotionStyles = null; const enteringStyles = null; /** * __Loading items__ * * Loading items conditionally render based on the useShouldNestedElementRender() hook. * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export const LoadingItems = ({ children, isLoading, fallback, testId }) => { const { shouldRender } = useShouldNestedElementRender(); if (!shouldRender) { return children; } return /*#__PURE__*/React.createElement(ExitingPersistence, null, /*#__PURE__*/React.createElement(FadeIn, { key: `loading-section-${isLoading}`, duration: "medium" }, (motion, state) => /*#__PURE__*/React.createElement("span", _extends({}, motion, { "data-testid": testId && `${testId}--${state}`, className: ax(["_kqswstnw _1pbykb7n _154iidpf _1xi2idpf _1ltvidpf", state === 'entering' && "_kqswpfqs _1pbycs5v"]) }), isLoading ? fallback : children))); };