How to use the react.PropTypes.bool function in react

To help you get started, weโ€™ve selected a few react 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 joshwcomeau / key-and-pad / src / components / FeatureHighlight / index.js View on Github external
>
          {this.renderPointer()}
        
      
    );
  }
}

FeatureHighlight.propTypes = {
  children: PropTypes.node,
  style: PropTypes.object,
  className: PropTypes.string,
  centerHorizontally: PropTypes.bool,
  centerVertically: PropTypes.bool,
  gradient: PropTypes.bool,
  animateInitialPosition: PropTypes.bool,
  transposeLength: PropTypes.number,
  fadeLength: PropTypes.number,
  showFeature: PropTypes.bool,
  removeFeature: PropTypes.bool,
  pointerOptions: PropTypes.array, // validated in FeaturePointer component
};

FeatureHighlight.defaultProps = {
  style: {},
  animateInitialPosition: false,
  transposeLength: 1000,
  fadeLength: 1600,
  pointerOptions: [],
};

export default FeatureHighlight;
github Katochimoto / xblocks / src / blocks / select / select.jsx View on Github external
*/
export default xv.Select = xblocks.view.register('xb-select', [
    xblocks.mixin.vCommonAttrs,

    {
        'displayName': 'xb-select',

        'propTypes': {
            'autocapitalize':   PropTypes.oneOf([ 'on', 'off' ]),
            'autocomplete':     PropTypes.oneOf([ 'on', 'off' ]),
            'autocorrect':      PropTypes.oneOf([ 'on', 'off' ]),
            'autofocus':        PropTypes.bool,
            'form':             PropTypes.string,
            'multiple':         PropTypes.bool,
            'name':             PropTypes.string,
            'required':         PropTypes.bool,
            'size':             PropTypes.string
        },

        'getDefaultProps': function () {
            return {
                'autofocus': false,
                'disabled':  false,
                'multiple':  false,
                'required':  false,
                'tabindex':  '1'
            };
        },

        'componentDidMount': function () {
            new Tether({
                element: this.refs.dropdown,
github NordicMuseum / Nordic-Museum-Audio-Guide / app / components / audioContentList.js View on Github external
automaticallyAdjustContentInsets={false}
      showsVerticalScrollIndicator={true}
    >
      {renderView}
    
  );
};

AudioContentList.propTypes = {
  tourStopTitle: PropTypes.string.isRequired,
  tourStopUUID: PropTypes.string.isRequired,
  audioContent: PropTypes.array,
  currentAudio: PropTypes.string,
  currentAudioTime: PropTypes.number,
  autoplayOn: PropTypes.bool.isRequired,
  screenReader: PropTypes.bool.isRequired,
  playerStatus: PropTypes.string.isRequired,
  locale: PropTypes.string.isRequired,
  actions: PropTypes.shape({
    toggleAudioTranscript: PropTypes.func.isRequired,
    loadAudio: PropTypes.func.isRequired,
    togglePausePlay: PropTypes.func.isRequired,
  }),
};

export default AudioContentList;
github howlowck / train-faces / src / components / forms / WebcamInput / WebcamInput.js View on Github external
shape='circle'
          size='large'
          icon='camera-o' />
      
    )
  }
}

WebcamInput.propTypes = {
  className: PropTypes.string,
  width: PropTypes.number,
  height: PropTypes.number,
  viewWidth: PropTypes.number,
  viewHeight: PropTypes.number,
  onCaptureClick: PropTypes.func,
  enabled: PropTypes.bool
}

WebcamInput.defaultProps = {
  width: 480,
  height: 360,
  captureLabel: 'Action',
  onCaptureClick: (data) => {},
  enabled: false,
  viewWidth: 480,
  viewHeight: 360
}

export default WebcamInput
github jenkinsci / jenkins-design-language / src / js / components / modal / modalview.js View on Github external
beforeClose: PropTypes.func,
    beforeOpen: PropTypes.func,
    body: PropTypes.string,
    children: PropTypes.node,
    hideOnOverlayClicked: PropTypes.bool,
    isVisible: PropTypes.bool,
    onOverlayClicked: PropTypes.func,
    showOverlay: PropTypes.bool,
    styles: React.PropTypes.oneOfType([
        PropTypes.shape({
            closeButtonStyle: PropTypes.object,
            dialogStyles: PropTypes.object,
            overlayStyles: PropTypes.object,
            titleStyle: PropTypes.object
        }),
        PropTypes.bool,
    ]),
    transitionClass: PropTypes.string,
    transitionDuration: PropTypes.number,
    result: PropTypes.string,
    title: PropTypes.string,
    ignoreEscapeKey: PropTypes.bool
};

export {
    Body as ModalBody,
    defaultStyles as ModalStyles,
    ModalView,
    Header as ModalHeader,
};
github Imater / 4redux / src / components / Conditional / Conditional.jsx View on Github external
import React, { Component, PropTypes as pt } from 'react'
import cx from 'classnames'

import styles from './Conditional.styl'

export default class Conditional extends Component {
  static propTypes = {
    mode: pt.oneOf([]),
    isHello: pt.bool,
    children: pt.oneOfType([pt.node, pt.arrayOf(pt.node)])
  }
  static defaultProps = {
    mode: 'h5'
  }
  render() {
    const { mode, children, isHello } = this.props
    return (
      <div>
        {isHello &amp;&amp; 'Hello - if'}
        {isHello || 'Bye - unless'}</div>
github cjdev / visual-stack / packages / visual-stack / src / components / Sidebar.js View on Github external
navOptions = children;
  }

  return (
    <div>
      <button>
        <i></i>
        {label}
      </button>
      {navOptions}
    </div>
  );
};

NavGroup.propTypes = {
  open: PropTypes.bool,
};

export const Sidebar = ({ children }) =&gt; {
  return (
    <div>
      { children }
    </div>
  );
};
github react-component / select / src / Select.jsx View on Github external
valueObjectShape = PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.shape({
      key: PropTypes.string,
      label: PropTypes.node,
    }),
  ]);
}

const Select = React.createClass({
  propTypes: {
    defaultActiveFirstOption: PropTypes.bool,
    multiple: PropTypes.bool,
    filterOption: PropTypes.any,
    showSearch: PropTypes.bool,
    disabled: PropTypes.bool,
    allowClear: PropTypes.bool,
    showArrow: PropTypes.bool,
    tags: PropTypes.bool,
    prefixCls: PropTypes.string,
    className: PropTypes.string,
    transitionName: PropTypes.string,
    optionLabelProp: PropTypes.string,
    optionFilterProp: PropTypes.string,
    animation: PropTypes.string,
    choiceTransitionName: PropTypes.string,
    onChange: PropTypes.func,
    onBlur: PropTypes.func,
    onSelect: PropTypes.func,
    onSearch: PropTypes.func,
    placeholder: PropTypes.any,
    onDeselect: PropTypes.func,
github dnnsoftware / Dnn.Platform / src / Modules / Settings / Dnn.PersonaBar.Servers / Servers.Web / src / components / Tabs / Performance.jsx View on Github external
globalTooltipStyle={{margin: "8px 0px 0px 5px"}}/&gt;
                
            
            <div>
            <div>
                <button disabled="{props.isSaving}" type="primary">{localization.get("SaveButtonText")}</button>
            </div>
        </div>;
    }
}

Performance.propTypes = {
    performanceSettings: PropTypes.object.isRequired,
    loading: PropTypes.bool,
    isSaving: PropTypes.bool,
    incrementingVersion: PropTypes.bool,
    errorMessage: PropTypes.string,
    onRetrievePerformanceSettings: PropTypes.func.isRequired,
    onChangePerformanceSettingsValue: PropTypes.func.isRequired,
    onSave: PropTypes.func.isRequired,
    onIncrementVersion: PropTypes.func.isRequired,
    infoMessage: PropTypes.string
};

function mapStateToProps(state) {
    return {
        performanceSettings: state.performanceTab.performanceSettings,
        loading: state.performanceTab.saving,
        isSaving: state.performanceTab.saving,
        incrementingVersion: state.performanceTab.incrementingVersion,
        errorMessage: state.logsTab.errorMessage,
github gabrielbull / react-desktop / src / ListView / ListView.windows.js View on Github external
static propTypes = {
    id: PropTypes.string,
    masterWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    detailsWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    push: PropTypes.bool
  };

  static defaultProps = {
    push: true
  };

  static childContextTypes = {
    id: PropTypes.string,
    masterWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    detailsWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    push: PropTypes.bool
  };

  getChildContext() {
    return {
      id: this.id,
      masterWidth: this.props.masterWidth,
      detailsWidth: this.props.detailsWidth,
      push: typeof this.props.push === 'undefined' ? this.defaultProps.push : this.props.push
    };
  }

  constructor(props, context, updater) {
    let { id, ...properties } = props;
    super(properties, context, updater);
    this.id = id || 'listview';
  }