How to use the prop-types.PropTypes.string function in prop-types

To help you get started, we’ve selected a few prop-types 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 linode / manager / components / tables / cells / LinkCell.js View on Github external
{children}
      
      {tooltipComponent}
      {subtitleFn ? <div><small>{subtitleFn(record)}</small></div> : null}
    
  );
}

LinkCell.propTypes = {
  cellIndex: PropTypes.number,
  children: PropTypes.node,
  className: PropTypes.string,
  column: PropTypes.shape({
    disableTooltip: PropTypes.bool,
    hrefFn: PropTypes.func.isRequired,
    textKey: PropTypes.string,
    // TODO: consider generalizing textFn for formatting
    textFn: PropTypes.func,
    subtitleFn: PropTypes.func,
  }).isRequired,
  record: PropTypes.object.isRequired,
};
github hummingbird-me / kitsu-mobile / src / components / Button / component.js View on Github external
: 
    }
  
);

Button.propTypes = {
  ...TouchableOpacity.propTypes,
  style: ViewPropTypes.style,
  title: PropTypes.string.isRequired,
  titleStyle: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
  icon: PropTypes.string,
  iconStyle: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
  onPress: PropTypes.func.isRequired,
  loading: PropTypes.bool,
  disabled: PropTypes.bool,
};
Button.defaultProps = {
  style: null,
  title: 'Save',
  titleStyle: null,
  icon: null,
  iconStyle: null,
  loading: false,
  disabled: false,
};
github TakwimuAfrica / Takwimu / takwimu / takwimu_ui / src / components / AnalysisContent / ContentNavigation.js View on Github external
onClick={(e, index) => showContent(index)()}
      linksPrimaryColor={linksPrimaryColor}
      linksSecondaryColor={linksSecondaryColor}
    />
  );
}

AnalysisContentNavigation.propTypes = {
  labelText: PropTypes.string.isRequired,
  labelTextStrong: PropTypes.string.isRequired,
  classes: PropTypes.shape({}).isRequired,
  current: PropTypes.number.isRequired,
  content: PropTypes.shape({}).isRequired,
  showContent: PropTypes.func.isRequired,
  linksPrimaryColor: PropTypes.string,
  linksSecondaryColor: PropTypes.string
};

AnalysisContentNavigation.defaultProps = {
  linksPrimaryColor: 'primary',
  linksSecondaryColor: 'textPrimary'
};

export default withStyles(styles)(AnalysisContentNavigation);
github smollweide / react-speed-dial / src / components / speed-dial / speed-dial.prop-types.js View on Github external
import { PropTypes } from 'prop-types';

export default {
	children: PropTypes.any,
	className: PropTypes.string,
	classNameBackdrop: PropTypes.string,
	classNameButtonWrap: PropTypes.string,
	classNameInTransition: PropTypes.string,
	classNameOpen: PropTypes.string,
	closeOnSecondClick: PropTypes.bool,
	closeOnScrollDown: PropTypes.bool,
	closeOnScrollUp: PropTypes.bool,
	enableMouseActions: PropTypes.bool,
	floatingActionButtonProps: PropTypes.shape({
		backgroundColor: PropTypes.string,
		className: PropTypes.string,
		disabled: PropTypes.bool,
		iconClassName: PropTypes.string,
		iconStyle: PropTypes.object,
		mini: PropTypes.bool,
		secondary: PropTypes.bool,
		style: PropTypes.object,
		zDepth: PropTypes.number,
	}),
	hasBackdrop: PropTypes.bool,
	icon: PropTypes.object,
	iconOpen: PropTypes.object,
	isInitiallyOpen: PropTypes.bool,
	isOpen: PropTypes.bool,
	positionH: PropTypes.string,
	positionV: PropTypes.string,
github hackoregon / civic / packages / 2019-disaster-game / src / components / atoms / TitleBar / JourneyBar.new.js View on Github external
)}

        {helpNeighborsCompleted &amp;&amp; (
          <img alt="Checkmark" src="{CheckmarkSVG}">
        )}
        <p>HELP NEIGHBORS</p>
      
    
  );
};

JourneyBar.propTypes = {
  badge: PropTypes.shape({
    badgeSVG: PropTypes.string,
    title: PropTypes.string,
    id: PropTypes.string,
    shown: PropTypes.bool,
    activeTaskIndexWhenEarned: PropTypes.oneOfType([null, PropTypes.number])
  }),
  activeChapterIndex: PropTypes.number,
  activeChapterId: PropTypes.string,
  activeTaskPhase: PropTypes.string,
  activeChapterDuration: PropTypes.number,
  allTaskPhaseData: PropTypes.objectOf(
    PropTypes.shape({
      time: PropTypes.number
    })
  ),
  activeTaskIndex: PropTypes.number
};
github mu29 / react-stepper / src / Stepper.js View on Github external
);
}

Stepper.defaultProps = {
  activeStep: 0,
};

Stepper.propTypes = {
  activeStep: PropTypes.number,
  steps: PropTypes.array,
  activeColor: PropTypes.string,
  completeColor: PropTypes.string,
  defaultColor: PropTypes.string,
  activeTitleColor: PropTypes.string,
  completeTitleColor: PropTypes.string,
  defaultTitleColor: PropTypes.string,
  circleFontColor: PropTypes.string,
  size: PropTypes.number,
  circleFontSize: PropTypes.number,
  titleFontSize: PropTypes.number,
  circleTop: PropTypes.number,
  titleTop: PropTypes.number,
  defaultOpacity: PropTypes.string,
  completeOpacity: PropTypes.string,
  activeOpacity: PropTypes.string,
  defaultTitleOpacity: PropTypes.string,
  completeTitleOpacity: PropTypes.string,
  activeTitleOpacity: PropTypes.string,
  barStyle: PropTypes.string,
  defaultBarColor: PropTypes.string,
github US-CBP / GTAS / gtas-ui / src / components / Inputs / File.js View on Github external
value={props.inputVal}
    alt={props.alt}
    accept={props.options.join(",")}
  />
);

//APB - validation by type. How to structure ??
//APB pass invalid state up to parent

FileInput.propTypes = {
  inputType: PropTypes.oneOf(["file"]).isRequired,
  name: PropTypes.string.isRequired,
  alt: PropTypes.string.isRequired,
  callback: PropTypes.func.isRequired,
  inputVal: PropTypes.any,
  required: PropTypes.string,
  placeHolder: PropTypes.string,
  options: PropTypes.array.isRequired
};
export default FileInput;
github mu29 / react-stepper / src / Step.js View on Github external
circleTop: 24,
  titleTop: 8,
  defaultBarColor: '#E0E0E0',
  barStyle: 'solid',
  borderStyle: 'solid',
  lineMarginOffset: 4,
  defaultBorderWidth: 3
};

Step.propTypes = {
  width: PropTypes.number.isRequired,
  activeColor: PropTypes.string,
  completeColor: PropTypes.string,
  defaultColor: PropTypes.string,
  activeTitleColor: PropTypes.string,
  completeTitleColor: PropTypes.string,
  defaultTitleColor: PropTypes.string,
  circleFontColor: PropTypes.string,
  size: PropTypes.number,
  circleFontSize: PropTypes.number,
  titleFontSize: PropTypes.number,
  circleTop: PropTypes.number,
  titleTop: PropTypes.number,
  title: PropTypes.string,
  index: PropTypes.number,
  active: PropTypes.bool,
  completed: PropTypes.bool,
  first: PropTypes.bool,
  isLast: PropTypes.bool,
  completeOpacity: PropTypes.string,
  activeOpacity: PropTypes.string,
  defaultOpacity: PropTypes.string,
github orionhealth / XBDD / xbdd-web / src / modules / report / FeatureListContainer / FeatureListContainer.jsx View on Github external
handleClosed={this.handleWarningClosed}
          /&gt;
          
          <div>
            {this.renderFeatureListTitle(classes)}
            {this.renderFeatureList(userName, restId, selectedFeatureId, handleFeatureSelected)}
          </div>
        
      );
    }
    return null;
  }
}

FeatureListContainer.propTypes = {
  product: PropTypes.string,
  version: PropTypes.string,
  build: PropTypes.string,
  userName: PropTypes.string,
  selectedFeatureId: PropTypes.string,
  handleErrorMessageDisplay: PropTypes.func.isRequired,
  handleFeatureSelected: PropTypes.func.isRequired,
  classes: PropTypes.shape({}),
};

export default withStyles(featureListContainerStyles)(FeatureListContainer);