DappList.jsx
1 import React from 'react' 2 import PropTypes from 'prop-types' 3 import { DappListModel } from '../../utils/models' 4 import DappListItem from '../DappListItem' 5 6 const DappList = props => { 7 const { dapps, isRanked, showActionButtons } = props 8 return ( 9 dapps && 10 dapps.map((dapp, i) => ( 11 <DappListItem 12 dapp={dapp} 13 key={dapp.name} 14 isRanked={isRanked} 15 position={i + 1} 16 showActionButtons={showActionButtons} 17 /> 18 )) 19 ) 20 } 21 22 DappList.defaultProps = { 23 showActionButtons: true, 24 } 25 26 DappList.propTypes = { 27 dapps: DappListModel.isRequired, 28 isRanked: PropTypes.bool, 29 showActionButtons: PropTypes.bool, 30 } 31 32 export default DappList