2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-13 00:02:19 +01:00
|
|
|
import { DEFAULT_REL } from '../constants'
|
|
|
|
import Image from './image'
|
|
|
|
import Text from './text'
|
|
|
|
|
2020-08-17 21:07:16 +01:00
|
|
|
class ShopItem extends React.PureComponent {
|
2020-08-13 00:02:19 +01:00
|
|
|
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
image,
|
|
|
|
link,
|
|
|
|
name,
|
|
|
|
price,
|
|
|
|
} = this.props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<a
|
2020-08-18 21:49:11 +01:00
|
|
|
className={[_s.d, _s.w50PC, _s.noUnderline, _s.overflowHidden, _s.cursorPointer, _s.pb15, _s.pr5].join(' ')}
|
2020-08-13 00:02:19 +01:00
|
|
|
target='_blank'
|
|
|
|
rel={DEFAULT_REL}
|
|
|
|
href={link}
|
|
|
|
title={name}
|
|
|
|
>
|
|
|
|
<Image
|
|
|
|
src={image}
|
2020-08-18 21:43:06 +01:00
|
|
|
className={[_s.w100PC, _s.h122PX].join(' ')}
|
2020-08-13 00:02:19 +01:00
|
|
|
/>
|
|
|
|
|
|
|
|
<Text
|
|
|
|
align='center'
|
|
|
|
className={[_s.pt10, _s.px10].join(' ')}
|
|
|
|
>
|
|
|
|
{name}
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
{
|
|
|
|
!!price &&
|
|
|
|
<Text
|
|
|
|
size='small'
|
|
|
|
align='center'
|
|
|
|
color='tertiary'
|
|
|
|
className={[_s.pt5, _s.px10].join(' ')}
|
|
|
|
>
|
|
|
|
{price}
|
|
|
|
</Text>
|
|
|
|
}
|
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ShopItem.propTypes = {
|
|
|
|
image: PropTypes.string.isRequired,
|
|
|
|
link: PropTypes.string.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
price: PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ShopItem
|