File size: 1,138 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
import React, { Suspense, lazy } from "react";
import "./TvShow.scss";
import { connect } from "react-redux";
import {
selectTVItems,
selectIsTVFetching
} from "../../Redux/TVShow/tv-selectors";
import { getTvShows } from "../../Redux/TVShow/tv-actions";
const CollectionGridTVShows = React.lazy(() => import("../../Components/CollectionGrid/CollectionGridTVShows"));
const CollectionOverviewTVShows = React.lazy(() => import("../../Components/CollectionOverview/CollectionOverviewTVShows"));
const Footer = React.lazy(() => import("../../Components/Footer/Footer"));
class TvShow extends React.Component {
componentDidMount() {
this.props.dispatch(getTvShows());
}
render() {
return (
<div className="TV">
<Suspense fallback={<div></div>}>
<CollectionGridTVShows tvshow />
<CollectionOverviewTVShows tvshow />
<Footer />
</Suspense>
</div>
);
}
}
const mapStateToProps = state => ({
tvItems: selectTVItems(state),
isFetching: selectIsTVFetching(state)
});
export default connect(mapStateToProps)(TvShow);
|