Sha256: da1436d6deb3f803bd42362e467a2d5239bd61bd41a99931b638d27ac7e5e965

Contents?: true

Size: 1.36 KB

Versions: 25

Compression:

Stored size: 1.36 KB

Contents

import React, { useState } from 'react';
import {
  Dropdown,
  DropdownItem,
  KebabToggle,
  DropdownPosition,
} from '@patternfly/react-core';
import {
  INVENTORY_PAGE_TITLE,
  ACTIONS_HISTORY_BUTTON_TEXT,
  DOCS_BUTTON_TEXT,
} from '../../ForemanInventoryConstants';
import {
  getActionsHistoryUrl,
  getInventoryDocsUrl,
} from '../../ForemanInventoryHelpers';

const PageTitle = () => {
  const [isDropdownOpen, setIsDropdownOpen] = useState(false);
  const dropdownItems = [
    <DropdownItem
      key="tasks-history-button"
      href={getActionsHistoryUrl()}
      target="_blank"
      rel="noopener noreferrer"
    >
      {ACTIONS_HISTORY_BUTTON_TEXT}
    </DropdownItem>,
    <DropdownItem
      key="inventory-documentation-button"
      href={getInventoryDocsUrl()}
      target="_blank"
      rel="noopener noreferrer"
    >
      {DOCS_BUTTON_TEXT}
    </DropdownItem>,
  ];
  return (
    <div className="row form-group inventory-upload-header-title">
      <h1 className="col-md-8">{INVENTORY_PAGE_TITLE}</h1>
      <Dropdown
        className="title-dropdown"
        onSelect={() => setIsDropdownOpen(false)}
        toggle={<KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />}
        isOpen={isDropdownOpen}
        isPlain
        dropdownItems={dropdownItems}
        position={DropdownPosition.right}
      />
    </div>
  );
};
export default PageTitle;

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.18.1 webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js
foreman_rh_cloud-3.0.18 webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js
foreman_rh_cloud-3.0.17 webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js
foreman_rh_cloud-3.0.16 webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js
foreman_rh_cloud-3.0.15 webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js