This repository was archived by the owner on Jun 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathProfile.js
65 lines (58 loc) · 1.92 KB
/
Profile.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
import Content from '../Content';
import NavBar from '../NavBar';
import PageContent from '../PageContent';
import '../All.css';
import '../Mobile.css';
import LeftPanel from './leftpanel/LeftPanel';
import RightPanel from './rightpanel/RightPanel';
import './Profile.css';
import assert_internal from 'reassert/internal';
export {Profile};
class Profile extends React.Component {
constructor(props) {
super(props);
if( ! props.isServerRendering ) {
this.state = {
doNotRenderYet: true,
};
}
}
componentDidMount() {
this.setState({doNotRenderYet: false});
}
render() {
const {props} = this;
assert_internal(props.doNotRender===undefined || props.isServerRendering);
const showLoadingIcon = props.isServerRendering ? props.doNotRender : this.state.doNotRenderYet;
const content = (
showLoadingIcon ? (
<div className="col-12 pl-2 pr-0"><i className="fas fa-spinner fa-pulse"></i> <span>{props.username+"'s profile"}</span></div>
) : (
<React.Fragment>
<LeftPanel user={props.user} contribs={props.contribs}
orgsData={props.orgsData} />
<RightPanel username={props.user.login}
fetchedat={props.user.contribs && props.user.contribs.fetched_at}
contribs={props.contribs}
being_created={props.user.ghuser_being_created}
deleted_because={props.user.ghuser_deleted_because}
allRepoData={props.allRepoData}
profilesBeingCreated={props.profilesBeingCreated} />
</React.Fragment>
)
);
return (
<PageContent>
<NavBar/>
<Content>
<div className="container container-lg mt-2">
<div className="row">
{ content }
</div>
</div>
</Content>
</PageContent>
);
}
}