How to use the bpk-react-utils.wrapDisplayName function in bpk-react-utils

To help you get started, we’ve selected a few bpk-react-utils 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 Skyscanner / backpack / packages / bpk-component-input / src / withOpenEvents.js View on Github external
('ontouchstart' in window ||
        // eslint-disable-next-line no-undef
        (window.DocumentTouch && document instanceof DocumentTouch))
    ),
    onOpen: null,
    // Input props
    className: null,
    onClick: null,
    onFocus: null,
    onBlur: null,
    onTouchEnd: null,
    onKeyDown: null,
    onKeyUp: null,
  };

  WithOpenEvents.displayName = wrapDisplayName(
    InputComponent,
    'withOpenEvents',
  );

  return WithOpenEvents;
};
github Skyscanner / backpack / packages / bpk-component-accordion / src / withAccordionItemState.js View on Github external
}
  }

  WithAccordionItemState.propTypes = {
    initiallyExpanded: PropTypes.bool,
    expanded: PropTypes.bool,
    onClick: PropTypes.func,
  };

  WithAccordionItemState.defaultProps = {
    initiallyExpanded: false,
    expanded: false,
    onClick: null,
  };

  WithAccordionItemState.displayName = wrapDisplayName(
    ComposedComponent,
    'withAccordionItemState',
  );

  return WithAccordionItemState;
};
github Skyscanner / backpack / packages / bpk-component-banner-alert / src / withBannerAlertState.js View on Github external
return (
         0) || animateOnLeave}
          {...rest}
        >
          {children}
        
      );
    }
  }

  component.displayName = wrapDisplayName(
    WrappedComponent,
    'withBannerAlertState',
  );

  return component;
};
github Skyscanner / backpack / packages / bpk-component-rtl-toggle / src / updateOnDirectionChange.js View on Github external
DIRECTION_CHANGE_EVENT,
        this.onDirectionChange,
        false,
      );
    }

    onDirectionChange = () => {
      this.forceUpdate();
    };

    render() {
      return ;
    }
  }

  UpdateOnDirectionChange.displayName = wrapDisplayName(
    EnhancedComponent,
    'updateOnDirectionChange',
  );

  return UpdateOnDirectionChange;
};
github Skyscanner / backpack / packages / bpk-component-barchart / hocs.js View on Github external
getBarSelection = point => isEqual(this.state.selectedPoint, point);

    render() {
      const { ...rest } = this.props;

      return (
        
      );
    }
  }

  WithSelectedState.displayName = wrapDisplayName(
    ComposedComponent,
    'withSelectedState',
  );

  return WithSelectedState;
};
github Skyscanner / backpack / packages / bpk-component-theme-toggle / src / updateOnThemeChange.js View on Github external
false,
      );
    }

    onThemeChange = e => {
      const { theme } = e.detail;
      this.setState({ theme });
      this.forceUpdate();
    };

    render() {
      return ;
    }
  }

  UpdateOnThemeChange.displayName = wrapDisplayName(
    EnhancedComponent,
    'updateOnThemeChange',
  );

  UpdateOnThemeChange.propTypes = {
    children: PropTypes.node.isRequired,
  };

  return UpdateOnThemeChange;
};
github Skyscanner / backpack / packages / bpk-scrim-utils / src / withScrim.js View on Github external
return (
        <div>
          
          
        </div>
      );
    }
  }

  WithScrim.displayName = wrapDisplayName(WrappedComponent, 'withScrim');

  return WithScrim;
};
github Skyscanner / backpack / packages / bpk-component-icon / src / withAlignment.js View on Github external
return (
      <span style="{{">
        
      </span>
    );
  };

  WithAlignment.displayName = wrapDisplayName(Component, 'withAlignment');

  return WithAlignment;
}
github Skyscanner / backpack / packages / bpk-component-image / src / withLoadingBehavior.js View on Github external
this.setState(() =&gt; ({
        loading: false,
      }));
    };

    render() {
      return (
        
      );
    }
  }
  WithLoadingBehavior.displayName = wrapDisplayName(
    Component,
    'withLoadingBehavior',
  );
  return WithLoadingBehavior;
}
github Skyscanner / backpack / packages / bpk-component-icon / src / withDescription.js View on Github external
export default function withDescription(
  Component: AbstractComponent,
  description: string,
): AbstractComponent {
  const WithDescription = props =&gt; (
    <span>
      
      <span>
        {description}
      </span>
    </span>
  );

  WithDescription.displayName = wrapDisplayName(Component, 'withDescription');

  return WithDescription;
}

bpk-react-utils

Utilities for Backpack's React components.

Apache-2.0
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis

Similar packages