Completed
Push — master ( 7afd13...66f5e8 )
by Junior
28s
created

src/containers/ProfileContainer.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 18
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 0
c 2
b 0
f 1
nc 1
dl 0
loc 18
rs 10
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0
1
import { compose, branch, renderComponent, renderNothing } from 'recompose';
2
import { graphql } from 'react-apollo';
3
import { isEmpty, propOr } from 'ramda';
4
import { getProfileInfo } from 'services/graphQLQuery';
5
import ProfileComponent from 'components/ProfileComponent';
6
7
export default compose(
8
  graphql(getProfileInfo, {
9
    name: `profile`,
10
  }),
11
  branch(
12
    ({ profile }) => profile.loading || profile.errors || isEmpty(propOr(`user`, profile, null)),
13
    renderComponent(renderNothing()),
14
  ),
15
)(ProfileComponent);
16