import React from 'react'; import { connect } from 'react-redux'; import { listShortUrls } from './reducers/shortUrlsList'; import { isEmpty } from 'ramda'; export class ShortUrlsList extends React.Component { componentDidMount() { const { match } = this.props; this.props.listShortUrls(match.params.serverId); } render() { return ( ); } renderShortUrls() { const { shortUrlsList } = this.props; if (isEmpty(shortUrlsList)) { return
  • Loading...
  • ; } return shortUrlsList.map(shortUrl => (
  • {`${shortUrl.shortCode}`}
  • )); } } export default connect(state => ({ shortUrlsList: state.shortUrlsList }), { listShortUrls })(ShortUrlsList);