File indexing completed on 2025-01-26 05:27:59
0001 import React, { Component } from 'react'; 0002 import RssNewsContainer from './RssNewsContainer'; 0003 import CommentsContainer from './CommentsContainer'; 0004 import RatingContainer from './RatingContainer'; 0005 import ProductsContainer from './ProductsContainer'; 0006 import MySpamContainer from './MySpamContainer'; 0007 import ChatContainer from './ChatContainer'; 0008 import ProductsGitContainer from './ProductsGitContainer'; 0009 import Introduction from './Introduction'; 0010 import PersonalLinksContainer from '../function/PersonalLinksContainer'; 0011 import AdminLinksContainer from '../function/AdminLinksContainer'; 0012 import BlogFeedContainer from './BlogFeedContainer'; 0013 import WatchlistContainer from '../function/WatchlistContainer'; 0014 import StatisticsContainer from '../function/StatisticsContainer'; 0015 import ProductsMyGitContainer from './ProductsMyGitContainer'; 0016 class HomeMainContainer extends Component { 0017 constructor(props){ 0018 super(props); 0019 this.state ={...window.data}; 0020 } 0021 render() { 0022 let content; 0023 let supporterinfo; 0024 if(this.state.supporterinfo && this.state.supporterinfo.member_id) 0025 { 0026 supporterinfo = <div>Thanks for supporting Pling.com</div> 0027 }else{ 0028 supporterinfo = <div><a href={this.state.baseUrlStore+"/support"}>Become a Supporter</a></div> 0029 } 0030 if(this.state.user) 0031 { 0032 content = ( 0033 <div id="home-main-container"> 0034 <div className="top"> 0035 <div className="personal-container-top"> 0036 0037 <div className="userinfo"> 0038 <img className="image-profile" src={this.state.user.avatar}></img> 0039 {supporterinfo} 0040 </div> 0041 <h1> 0042 Hi {this.state.user.username}, good to see you!</h1> 0043 0044 0045 <PersonalLinksContainer myopendesktopUrl={this.state.url_myopendesktop} 0046 docsopendesktopUrl={this.state.url_docsopendesktop} 0047 riotUrl = {this.state.riotUrl} 0048 mastodonUrl = {this.state.mastodonUrl} 0049 forumUrl ={this.state.forumUrl} 0050 musicopendesktopUrl ={this.state.url_musicopendesktop} 0051 user ={this.state.user} 0052 baseUrlStore={this.state.baseUrlStore} 0053 gitlabUrl = {this.state.gitlabUrl} 0054 mastodonUrl={this.state.url_mastodon} 0055 0056 /> 0057 </div> 0058 </div> 0059 <div className="middle"> 0060 <ProductsContainer baseUrlStore={this.state.baseUrlStore} title="Products" products={this.state.products}/> 0061 <ProductsMyGitContainer urlCode={this.state.gitlabUrl} user={this.state.user}/> 0062 0063 <CommentsContainer title="Last 10 comments received" baseUrlStore={this.state.baseUrlStore} comments={this.state.comments}/> 0064 <CommentsContainer title="Last 10 moderation" baseUrlStore={this.state.baseUrlStore} comments={this.state.commentsmoderation} type='moderation'/> 0065 <RatingContainer title="Last 10 ratings received" baseUrlStore={this.state.baseUrlStore} votes={this.state.votes}/> 0066 { this.state.spams.length>0 && 0067 <MySpamContainer title="Spam" baseUrlStore={this.state.baseUrlStore} spams={this.state.spams}/> 0068 } 0069 { this.state.user.isAdmin && 0070 <> 0071 <div className="panelContainer"> 0072 <div className="title">Watchlist(Admin only)</div> 0073 <WatchlistContainer user={this.state.user} baseUrlStore={this.state.baseUrlStore}/> 0074 </div> 0075 <div className="panelContainer"> 0076 <div className="title">Admin(Admin only)</div> 0077 <AdminLinksContainer user={this.state.user} baseUrlStore={this.state.baseUrlStore}/> 0078 </div> 0079 <div className="panelContainer"> 0080 <div className="title">Statistics(Admin only)</div> 0081 <StatisticsContainer user={this.state.user} baseUrlStore={this.state.baseUrlStore}/> 0082 </div> 0083 </> 0084 } 0085 0086 </div> 0087 </div> 0088 ) 0089 }else{ 0090 content = ( 0091 <div id="home-main-container"> 0092 <div className="top"> 0093 <Introduction urlCode={this.state.gitlabUrl} 0094 urlPublish={this.state.baseUrlStore} 0095 urlCommunity={this.state.forumUrl} 0096 urlPersonal={this.state.url_myopendesktop} 0097 /> 0098 </div> 0099 <div className="middle"> 0100 <ProductsGitContainer urlCode={this.state.gitlabUrl}/> 0101 <ProductsContainer baseUrlStore={this.state.baseUrlStore} title="Apps and Addons" cat="152" products={this.state.products}/> 0102 <ProductsContainer baseUrlStore={this.state.baseUrlStore} title="Themes" cat="148" products={this.state.productsThemes}/> 0103 <ProductsContainer baseUrlStore={this.state.baseUrlStore} title="Multimedia" cat="586" products={this.state.productsMultimedia}/> 0104 <ChatContainer /> 0105 <CommentsContainer title="Comments" baseUrlStore={this.state.baseUrlStore} comments={this.state.comments}/> 0106 <BlogFeedContainer urlCommunity={this.state.forumUrl}/> 0107 <RssNewsContainer /> 0108 </div> 0109 </div> 0110 ) 0111 } 0112 0113 return ( 0114 <React.Fragment> 0115 {content} 0116 </React.Fragment> 0117 ); 0118 } 0119 } 0120 export default HomeMainContainer;