Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ExpandedLabelPopup.js 894B

12345678910111213141516171819202122232425262728293031323334353637
  1. // @flow
  2. import React from 'react';
  3. import BaseTheme from '../../../base/ui/components/BaseTheme';
  4. import { EXPANDED_LABELS } from './constants';
  5. type Props = {
  6. /**
  7. * The selected label to show details.
  8. */
  9. visibleExpandedLabel: ?string
  10. }
  11. const ExpandedLabelPopup = ({ visibleExpandedLabel }: Props) => {
  12. if (visibleExpandedLabel) {
  13. const expandedLabel = EXPANDED_LABELS[visibleExpandedLabel];
  14. if (expandedLabel) {
  15. const LabelComponent = expandedLabel.component || expandedLabel;
  16. const { props, alwaysOn } = expandedLabel || {};
  17. const style = {
  18. top: alwaysOn ? BaseTheme.spacing[6] : BaseTheme.spacing[1]
  19. };
  20. return (<LabelComponent
  21. { ...props }
  22. style = { style } />);
  23. }
  24. }
  25. return null;
  26. };
  27. export default ExpandedLabelPopup;