How to use the @shopify/app-bridge/actions.Modal.Size function in @shopify/app-bridge

To help you get started, we’ve selected a few @shopify/app-bridge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / polaris-react / src / components / Modal / Modal.tsx View on Github external
private transformProps() {
    const {
      title,
      size,
      message,
      src,
      primaryAction,
      secondaryActions,
      polaris,
    } = this.props;
    const {appBridge} = polaris;

    if (!appBridge) return;

    const safeTitle = typeof title === 'string' ? title : undefined;
    const safeSize = size != null ? AppBridgeModal.Size[size] : undefined;
    const srcPayload: {url?: string; path?: string} = {};

    if (src != null) {
      if (/^https?:\/\//.test(src)) {
        srcPayload.url = src;
      } else {
        srcPayload.path = src;
      }
    }

    return {
      title: safeTitle,
      message,
      size: safeSize,
      ...srcPayload,
      footer: {