Skip to content

Instantly share code, notes, and snippets.

@rajatk16
Created July 18, 2018 07:43
Show Gist options
  • Select an option

  • Save rajatk16/600b10901ceb5135b12ffb1ba47c7e2a to your computer and use it in GitHub Desktop.

Select an option

Save rajatk16/600b10901ceb5135b12ffb1ba47c7e2a to your computer and use it in GitHub Desktop.
export default class Profile extends PureComponent {
static propTypes = {
userIsLoaded: PropTypes.bool,
user: PropTypes.shape({
_id: PropTypes.string,
}).isRequired,
}
static defaultProps = {
userIsLoaded: false,
}
render() {
const { userIsLoaded, user } = this.props;
if (!userIsLoaded) return <Loaded />;
return (
<div>
<div className="two-col">
<section>
<MyOrders userId={user.id} />
<My Downloads userId={user._id} />
</section>
<aside>
<MySubscriptions user={user} />
<MyVotes user={user} />
</aside>
</div>
<div className="one-col">
{isRole('affiliate', user={user._id} &&
<MyAffiliateInfo userId={user._id} />
}
</div>
</div>
)
}
}
@derrickwilliams
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment