@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
37 lines • 1.27 kB
JavaScript
import React, { forwardRef } from 'react';
import AddIcon from '@atlaskit/icon/core/add';
import { fg } from '@atlaskit/platform-feature-flags/fg';
import { ResponsiveButton } from './responsive-button';
import { Button } from './themed/button';
import { IconButton } from './themed/icon-button';
/**
* __Create button__
*
* The create button for the top navigation.
* With platform-dst-chat-panel-layout enabled, shows only its icon below the
* enclosing TopNav's 48rem breakpoint. Children remain its accessible label.
*/
export var CreateButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
var children = _ref.children,
onClick = _ref.onClick,
testId = _ref.testId,
interactionName = _ref.interactionName;
return fg('platform-dst-chat-panel-layout') ? /*#__PURE__*/React.createElement(ResponsiveButton, {
ref: ref,
appearance: "primary",
iconButton: IconButton,
isTooltipDisabled: false,
icon: AddIcon,
label: children,
onClick: onClick,
testId: testId,
interactionName: interactionName
}) : /*#__PURE__*/React.createElement(Button, {
ref: ref,
appearance: "primary",
iconBefore: AddIcon,
onClick: onClick,
testId: testId,
interactionName: interactionName
}, children);
});