How to use the react-instantsearch-dom.createClassNames function in react-instantsearch-dom

To help you get started, we’ve selected a few react-instantsearch-dom 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 algolia / react-instantsearch / packages / react-instantsearch-dom-maps / src / Redo.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import { createClassNames, translatable } from 'react-instantsearch-dom';
import GeoSearchContext from './GeoSearchContext';
import withGoogleMaps from './withGoogleMaps';

const cx = createClassNames('GeoSearch');
const RedoPropTypes = {
  googleMapsInstance: PropTypes.object.isRequired,
  translate: PropTypes.func.isRequired,
};

export const Redo = ({
  googleMapsInstance,
  translate,
  hasMapMoveSinceLastRefine,
  refineWithInstance,
}) => (
  <div>
    <button disabled="{!hasMapMoveSinceLastRefine}"> refineWithInstance(googleMapsInstance)}</button></div>
github algolia / react-instantsearch / packages / react-instantsearch-dom-maps / src / GoogleMaps.js View on Github external
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { createClassNames } from 'react-instantsearch-dom';
import { LatLngPropType, BoundingBoxPropType } from './propTypes';

const cx = createClassNames('GeoSearch');

class GoogleMaps extends Component {
  static propTypes = {
    google: PropTypes.object.isRequired,
    initialZoom: PropTypes.number.isRequired,
    initialPosition: LatLngPropType.isRequired,
    mapOptions: PropTypes.object.isRequired,
    onChange: PropTypes.func.isRequired,
    onIdle: PropTypes.func.isRequired,
    shouldUpdate: PropTypes.func.isRequired,
    boundingBox: BoundingBoxPropType,
    boundingBoxPadding: PropTypes.number,
    children: PropTypes.node,
  };

  static childContextTypes = {
github algolia / react-instantsearch / packages / react-instantsearch-dom-maps / src / Control.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import { createClassNames, translatable } from 'react-instantsearch-dom';
import GeoSearchContext from './GeoSearchContext';
import withGoogleMaps from './withGoogleMaps';

const cx = createClassNames('GeoSearch');
const ControlPropTypes = {
  googleMapsInstance: PropTypes.object.isRequired,
  translate: PropTypes.func.isRequired,
};

export const Control = ({
  googleMapsInstance,
  translate,
  isRefineOnMapMove,
  hasMapMoveSinceLastRefine,
  toggleRefineOnMapMove,
  refineWithInstance,
}) =&gt; (
  <div>
    {isRefineOnMapMove || !hasMapMoveSinceLastRefine ? (
      <label></label></div>