2020-03-27 13:59:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import Icon from 'gabsocial/components/icon';
|
|
|
|
import ProBadge from 'gabsocial/components/pro_badge';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2020-04-11 15:50:42 -07:00
|
|
|
const mapStateToProps = state => ({
|
|
|
|
promoItems: state.getIn(['soapbox', 'promoPanel', 'items']),
|
|
|
|
})
|
|
|
|
|
|
|
|
export default @connect(mapStateToProps)
|
2020-03-27 13:59:38 -07:00
|
|
|
class PromoPanel extends React.PureComponent {
|
|
|
|
|
|
|
|
render() {
|
2020-04-11 15:50:42 -07:00
|
|
|
const { promoItems } = this.props;
|
2020-03-27 13:59:38 -07:00
|
|
|
if (!promoItems) return null;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='wtf-panel promo-panel'>
|
|
|
|
<div className='promo-panel__container'>
|
|
|
|
{promoItems.map((item, i) =>
|
|
|
|
<div className='promo-panel-item' key={i}>
|
2020-04-11 15:50:42 -07:00
|
|
|
<a className='promo-panel-item__btn' href={item.get('url')} target='_blank'>
|
|
|
|
<Icon id={item.get('icon')} className='promo-panel-item__icon' fixedWidth />
|
|
|
|
{item.get('text')}
|
2020-03-27 13:59:38 -07:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|