prop-types#shape JavaScript Examples

The following examples show how to use prop-types#shape. 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: 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 #4
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 #5
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 #6
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 #7
Source File: CollectionRow.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
CollectionRow.propTypes = {
  collection: shape({}).isRequired,
  collectionId: string.isRequired,
  label: string.isRequired,
  navigation: shape({}).isRequired,
  selectCollectionAction: func.isRequired,
  updateIsAddingNewCollectionAction: func.isRequired,

};
Example #8
Source File: SubMenu.js    From react-menu with MIT License 6 votes vote down vote up
SubMenu.propTypes = {
  ...menuPropTypes,
  ...uncontrolledMenuPropTypes,
  disabled: bool,
  openTrigger: oneOf(['none', 'clickOnly']),
  label: oneOfType([node, func]),
  itemProps: shape({
    ...stylePropTypes()
  })
};
Example #9
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 #10
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 #11
Source File: types.js    From supportal-frontend with MIT License 5 votes vote down vote up
UserAuthType = shape({
  userId: string.isRequired,
  idToken: string.isRequired,
  timestamp: string,
  authenticated: bool.isRequired,
})
Example #12
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 #13
Source File: course-details.js    From what-front with MIT License 5 votes vote down vote up
CourseDetails.propTypes = {
  id: number.isRequired,
  coursesData: shape(coursesStateShape).isRequired,
};
Example #14
Source File: Stackable.props.js    From webrix with Apache License 2.0 5 votes vote down vote up
propTypes = {
    zIndex: number,
    target: instanceOf(Element),
    parent: shape({current: instanceOf(Element)}),
    children: node,
}
Example #15
Source File: index.js    From study-chain with MIT License 5 votes vote down vote up
blockPerHourType = arrayOf(
  shape({
    count: string,
    datetime: string
  })
)
Example #16
Source File: index.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
CatalogScreenHeader.propTypes = {
  collection: shape({}).isRequired,
  navigation: shape({}).isRequired,
};