UNPKG

746 BJavaScriptView Raw
1import React from 'react'
2import PropTypes from 'prop-types'
3import styled from 'styled-components'
4
5import PressIcon from 'SRC/core/icons/press/PressIcon'
6
7const IconRow = styled(({className, onClick, quotes, selected}) => {
8 return (
9 <div className={className}>
10 {quotes.map((icon, index) => {
11 const iconSelected = (index === selected)
12 return (
13 <PressIcon
14 key={index}
15 brand={quotes[index].id}
16 onClick={onClick(index)}
17 selected={iconSelected} />
18 )
19 })}
20 </div>
21 )
22})`
23 display: flex;
24 flex-wrap: wrap;
25 ${PressIcon} {
26 width: 25%;
27 }
28`
29
30IconRow.propTypes = {
31 iconsPerRow: PropTypes.number
32}
33
34/** @component */
35export default IconRow