How to use the terra-disclosure-manager.availableDisclosureSizes.MEDIUM function in terra-disclosure-manager

To help you get started, we’ve selected a few terra-disclosure-manager examples, based on popular ways it is used in public projects.

github cerner / terra-framework / packages / terra-slide-panel-manager / src / SlidePanelManager.jsx View on Github external
*/
  withDisclosureContainer: PropTypes.func,
};

const defaultProps = {
  panelBehavior: 'overlay',
};

/**
 * The SlidePanel component does not support the full range of DisclosureManager sizes in its API. The potential sizes are mapped to the
 * SlidePanel's supported sizes.
 */
const disclosureSizeToPanelSize = {
  [availableDisclosureSizes.TINY]: 'small',
  [availableDisclosureSizes.SMALL]: 'small',
  [availableDisclosureSizes.MEDIUM]: 'large',
  [availableDisclosureSizes.LARGE]: 'large',
  [availableDisclosureSizes.HUGE]: 'large',
};

const disclosureDimensionsToPanelSize = (dimensions) => {
  if (dimensions.width > 480 || dimensions.height > 600) {
    return 'large';
  }
  return 'small';
};

class SlidePanelManager extends React.Component {
  constructor(props) {
    super(props);

    this.renderSlidePanel = this.renderSlidePanel.bind(this);