prop-types#number JavaScript Examples

The following examples show how to use prop-types#number. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: types.js    From supportal-frontend with MIT License 6 votes vote down vote up
VolProspectContactEventType = shape({
  id: number,
  created_at: string,
  // metadata only exists if event is successful
  metadata: shape({
    status: oneOf(['SPECIFIC_EVENT', ...Object.keys(Successful)]),
  }),
  result: oneOf(VOL_PROSPECT_CONTACT_EVENT_RESULTS),
  vol_prospect_assignment: number,
})
Example #2
Source File: index.js    From juggernaut-desktop with MIT License 6 votes vote down vote up
messageType = shape({
  id: number.isRequired,
  conversationId: number.isRequired,
  contentType: string.isRequired,
  createdAt: number.isRequired,
  senderPubkey: string.isRequired,
  receiverPubkey: string.isRequired,
  content: string.isRequired,
  unread: bool.isRequired,
  valid: bool.isRequired,
  amountMSats: number.isRequired,
  feeAmountMSats: number.isRequired,
  response: shape({
    amountMSats: number.isRequired,
    feeAmountMSats: number.isRequired,
    createdAt: number.isRequired
  })
})
Example #3
Source File: FillPreview.js    From wix-style-react with MIT License 6 votes vote down vote up
FillPreview.propTypes = {
  /** render as some other component or DOM tag */
  as: oneOfType([func, object, string]),

  /** control focusability */
  tabIndex: number,

  /** Color, gradient, image url or svg to be rendered as a preview content */
  fill: oneOfType([string, node]),

  /** Outlines the border when set to true */
  selected: bool,

  /** Pass your handler for click event */
  onClick: func,

  /** Puts the component into a disabled state */
  disabled: bool,

  /** Control elements aspect ratio value:  */
  aspectRatio: oneOfType([string, number]),
};
Example #4
Source File: CalendarDay.js    From react-nice-dates with MIT License 6 votes vote down vote up
CalendarDay.propTypes = {
  date: instanceOf(Date).isRequired,
  height: number.isRequired,
  locale: object.isRequired,
  modifiers: objectOf(bool),
  modifiersClassNames: objectOf(string),
  onHover: func,
  onClick: func
}
Example #5
Source File: card.js    From what-front with MIT License 6 votes vote down vote up
Card.propTypes = {
  id: number.isRequired,
  title: string,
  date: string,
  buttonName: string,
  iconName: string,
  onDetails: func,
  onEdit: func,
  children: PropTypes.oneOfType([
    element,
    string,
    PropTypes.arrayOf(element),
  ]),
  className: string,
};
Example #6
Source File: Image.js    From dnd-builder with MIT License 6 votes vote down vote up
ImageElement.propTypes = {
  item: shape({
    defaultURL: string,
    height: oneOfType([
      number,
      string,
    ]),
    id: string,
    opacity: oneOfType([
      number,
      string,
    ]),
    roundedCorners: oneOfType([
      number,
      string,
    ]),
    url: string,
    width: oneOfType([
      number,
      string,
    ]),
  }),
  itemAccessor: func,
};
Example #7
Source File: commonTypes.js    From material-ui-color with MIT License 6 votes vote down vote up
color = oneOfType([
  shape({
    css: shape({
      // TODO
    }),
    value: number,
    hex: string,
    raw: oneOfType([string, array, number, shape]),
    name: string,
    alpha: number,
    rgb: arrayOf(number),
    hsv: arrayOf(number),
    hsl: arrayOf(number),
  }),
  string,
  number,
])
Example #8
Source File: Poppable.props.js    From webrix with Apache License 2.0 6 votes vote down vote up
propTypes = {
    container: oneOfType([
        func,
        shape({current: oneOfType([instanceOf(Element), instanceOf(_window.constructor)])}),
    ]),
    reference: oneOfType([
        func,
        instanceOf(DOMRect),
        shape({current: instanceOf(Element)}),
    ]),
    placements: func,
    placement: shape({
        top: number,
        left: number,
    }),
    overflow: func,
    onPlacement: func,
    default: number,
    children: node,
}
Example #9
Source File: index.js    From study-chain with MIT License 6 votes vote down vote up
blockHashType = shape({
  blockhash: string,
  blocknum: number,
  channelname: string,
  creatdt: string,
  datahash: string,
  prehash: string,
  txcount: number,
  txhash: arrayOf(string)
})
Example #10
Source File: BaseAccordion.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
AccordionHeader.propTypes = {
  item: shape({}).isRequired,
  expanded: bool.isRequired,
  fromDetailsPanel: bool,
  activeCollectionId: string.isRequired,
  fromDateAccordion: bool,
  maxRecordsCount: number,
  fromTimeSavedAccordion: bool,
};
Example #11
Source File: ControlledMenu.js    From react-menu with MIT License 6 votes vote down vote up
process.env.NODE_ENV !== "production" ? ControlledMenu.propTypes = /*#__PURE__*/_extends({}, rootMenuPropTypes, {
  state: /*#__PURE__*/oneOf( /*#__PURE__*/values(MenuStateMap)),
  anchorPoint: /*#__PURE__*/exact({
    x: number,
    y: number
  }),
  anchorRef: object,
  skipOpen: object,
  captureFocus: bool,
  menuItemFocus: /*#__PURE__*/exact({
    position: /*#__PURE__*/oneOfType([string, number]),
    alwaysUpdate: bool
  }),
  onClose: func
}) : void 0;
Example #12
Source File: Button.js    From littlelink-server with MIT License 6 votes vote down vote up
Button.propType = {
  src: string.isRequired,
  alt: string.isRequired,
  displayName: string.isRequired,
  href: string.isRequired,
  name: string.isRequired,
  order: number.isRequired,
  logo: string,
  icon: string,
  styles: object,
};
Example #13
Source File: types.js    From react-native-neomorph-shadows with MIT License 6 votes vote down vote up
ShadowARTType = {
  width: number.isRequired,
  height: number.isRequired,
  borderRadius: number,
  shadowRadius: number,
  shadowOffset: shape({
    x: number,
    y: number,
  }),
  shadowOpacity: number,
  shadowColor: string,
  backgroundColor: string,
}
Example #14
Source File: profile.js    From gatsby-theme-intro with MIT License 6 votes vote down vote up
ProfileType = {
  about: string.isRequired,
  budget: shape({
    currency: string.isRequired,
    default: number.isRequired,
    max: number.isRequired,
    min: number.isRequired,
  }).isRequired,
  company: string.isRequired,
  focus: string.isRequired,
  focus_url: string,
  for_hire: bool.isRequired,
  image: shape({
    childImageSharp: object.isRequired,
    publicURL: string.isRequired,
  }),
  initials: string.isRequired,
  location: string.isRequired,
  name: string.isRequired,
  profession: string.isRequired,
  relocation: bool.isRequired,
  skills: arrayOf(string).isRequired,
  tools: arrayOf(string).isRequired,
}
Example #15
Source File: types.js    From supportal-frontend with MIT License 5 votes vote down vote up
MobilizeTimeslotType = shape({
  start_date: number.isRequired,
  end_date: number.isRequired,
  id: number,
  is_full: bool,
})
Example #16
Source File: index.js    From juggernaut-desktop with MIT License 5 votes vote down vote up
walletType = shape({
  id: number.isRequired,
  host: string,
  macaroonPath: string,
  tlsCertPath: string,
  lndConnect: string
})
Example #17
Source File: Swatches.js    From wix-style-react with MIT License 5 votes vote down vote up
Swatches.propTypes = {
  /** Array of colors to be shown as swatches */
  colors: array,

  /** Selected color */
  selected: string,

  /** Data-hook for testing */
  dataHook: string,

  /** Callback function when user clicks on a swatch. Returns color HEX string representation. */
  onClick: func,

  /** Size of swatches */
  size: oneOf(['small', 'medium']),

  /** If true shows no color option */
  showClear: bool,

  /** optional message to display in tooltip when showClear is true */
  showClearMessage: node,

  /** Callback function when user clicks on Add button and selects a color to be added. Returns color HEX string representation. */
  onAdd: func,

  /** Callback function when user changes color in Color Picker. Returns color HEX string representation. */
  onChange: func,

  /** Callback function when user closes Color Picker without picking color. */
  onCancel: func,

  /** If true shows add button which triggers colors picker*/
  showAddButton: bool,

  /** Text for add button tooltip*/
  addButtonMessage: string,

  /** Size of Plus icon inside add button */
  addButtonIconSize: oneOf(['small', 'medium']),

  /** Number of maximum columns. Default value is 6 */
  columns: number,

  /** Gap between swatches. Default value is 12 */
  gap: number,
};
Example #18
Source File: Chart.jsx    From Turnip-Calculator with MIT License 5 votes vote down vote up
ChartComponent.propTypes = {
  filters: arrayOf(number).isRequired,
  minMaxPattern: arrayOf(arrayOf(number)),
  minWeekValue: number,
  patterns: arrayOf(arrayOf(arrayOf(number))),
  quantiles: arrayOf(arrayOf(number)),
};
Example #19
Source File: CountItem.js    From thekusuma with MIT License 5 votes vote down vote up
function CountItem({ number, text }) {
  return (
    <div css={styWrapperCount}>
      <h3>{number}</h3>
      <span>{text}</span>
    </div>
  );
}
Example #20
Source File: protected-route.js    From what-front with MIT License 5 votes vote down vote up
ProtectedRoute.propTypes = {
  roles: arrayOf(number).isRequired,
};
Example #21
Source File: PageAdder.js    From dnd-builder with MIT License 5 votes vote down vote up
PageAdder.propTypes = {
  additionalClass: string,
  onPageAdd: func,
  pageCount: number,
};
Example #22
Source File: Triangle.jsx    From webrix with Apache License 2.0 5 votes vote down vote up
Arrow.propTypes = {
    size: number,
};
Example #23
Source File: TurnTimer.js    From fifa with GNU General Public License v3.0 5 votes vote down vote up
renderTime.propTypes = {
  remainingTime: number.isRequired
};
Example #24
Source File: CollectionRow.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
CountInfo.propTypes = {
  count: number.isRequired,
  label: string,
  color: string,
};