| 2964 |
stevensc |
1 |
import React, { Suspense } from "react";
|
| 1 |
www |
2 |
import { connect } from "react-redux";
|
|
|
3 |
import { setTimelineUrl } from "../../../redux/feed/feed.actions";
|
|
|
4 |
import { feedTypes } from "../../../redux/feed/feed.types";
|
| 2964 |
stevensc |
5 |
import { addNotification } from "../../../redux/notification/notification.actions";
|
| 2966 |
stevensc |
6 |
import Spinner from "../../../shared/loading-spinner/Spinner";
|
|
|
7 |
import NotificationAlert from "../../../shared/notification/NotificationAlert";
|
|
|
8 |
import ShareModal from "../share-modal/ShareModal";
|
| 1 |
www |
9 |
|
| 2967 |
stevensc |
10 |
import SuggestedGroupsHelper from "../../../shared/helpers/suggested-groups-helper/SuggestedGroupsHelper";
|
|
|
11 |
import SocialNetworks from "./SocialNetworks";
|
|
|
12 |
import ShareFeed from "../share-feed/ShareFeed";
|
|
|
13 |
import PeopleYouMayKnow from "../../../shared/helpers/people-you-may-know/PeopleYouMayKnow";
|
|
|
14 |
import HomeNews from "./HomeNews";
|
|
|
15 |
|
| 2966 |
stevensc |
16 |
const FeedSection = React.lazy(() => import("../feed-section/FeedSection"));
|
| 2964 |
stevensc |
17 |
|
| 1 |
www |
18 |
import styles from "./HomeSection.module.scss";
|
|
|
19 |
|
|
|
20 |
const HomeSection = (props) => {
|
|
|
21 |
// props destructuring
|
|
|
22 |
const { routeTimeline, addNotification } = props;
|
|
|
23 |
|
|
|
24 |
// backendVars destructuring
|
|
|
25 |
const { image, fullName, country, visits, connections, description, feed } = props.backendVars;
|
|
|
26 |
|
|
|
27 |
// redux destructuring
|
|
|
28 |
const { setTimelineUrl } = props;
|
| 2207 |
stevensc |
29 |
|
| 1 |
www |
30 |
setTimelineUrl(routeTimeline);
|
|
|
31 |
return (
|
|
|
32 |
<div>
|
|
|
33 |
<div className="main-section">
|
|
|
34 |
<div className={styles.mainSection}>
|
| 1449 |
steven |
35 |
<div className="d-none d-sm-none d-md-block d-lg-block">
|
|
|
36 |
<div className={styles.sectionHeader}>
|
| 2967 |
stevensc |
37 |
<SuggestedGroupsHelper />
|
|
|
38 |
<SocialNetworks />
|
| 1447 |
steven |
39 |
</div>
|
| 1 |
www |
40 |
</div>
|
|
|
41 |
<div className={styles.feedSection}>
|
| 2967 |
stevensc |
42 |
<ShareFeed image={image} feedType={feedTypes.DASHBOARD} postUrl="/feed/add" />
|
| 2964 |
stevensc |
43 |
<Suspense
|
|
|
44 |
fallback={
|
| 2969 |
stevensc |
45 |
<div className="w-100 h-100" style={{ display: "grid", placeItems: 'center' }}>
|
| 2964 |
stevensc |
46 |
<Spinner />
|
|
|
47 |
</div>
|
|
|
48 |
}
|
|
|
49 |
>
|
|
|
50 |
<FeedSection
|
|
|
51 |
routeTimeline={routeTimeline}
|
|
|
52 |
feed={feed}
|
|
|
53 |
image={image}
|
|
|
54 |
/>
|
|
|
55 |
</Suspense>
|
| 1 |
www |
56 |
</div>
|
|
|
57 |
<div className={styles.peopleYouMayKnow}>
|
| 2967 |
stevensc |
58 |
<PeopleYouMayKnow />
|
|
|
59 |
<HomeNews />
|
| 1 |
www |
60 |
</div>
|
|
|
61 |
</div>
|
|
|
62 |
</div>
|
|
|
63 |
<ShareModal />
|
|
|
64 |
<NotificationAlert />
|
|
|
65 |
</div>
|
|
|
66 |
);
|
|
|
67 |
};
|
|
|
68 |
|
|
|
69 |
const mapDispatchToProps = {
|
|
|
70 |
setTimelineUrl: (url) => setTimelineUrl(url),
|
|
|
71 |
addNotification: (notification) => addNotification(notification),
|
|
|
72 |
};
|
|
|
73 |
|
|
|
74 |
export default connect(null, mapDispatchToProps)(HomeSection);
|