@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
36 lines • 1.13 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 const CreateButton = /*#__PURE__*/forwardRef(({
children,
onClick,
testId,
interactionName
}, ref) => 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));