You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ExpandedLabelPopup.tsx 900B

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