flake8
passed.
JSHint
passed.
Review Request #9675 — Created Feb. 18, 2018 and submitted
Here's the big one. This change converts the entire user detail view to
react, meaning the only backbone view that's left is the main
application view shell. Because this is the most complex page in the
entire application, it's a somewhat large change, but hopefully nothing
in here is too surprising.
Description | From | Last Updated |
---|---|---|
Since we're repeating this pattern, we may want to make this into a HOC function MentorRequired(ChildComponent) { const component = … |
brennie |
Since we're repeating this pattern, we may want to make this into a HOC
function MentorRequired(ChildComponent) { const component = ({isMentor, loggedIn, ...props}) => { if (isMentor) { return <ChildComponent {...props} />; } else { return <PermissionDenied loggedIn={loggedIn} />; } }; // https://www.npmjs.com/package/react-display-name component.displayName = `MentorRequired(${getDisplayName(Component)})`; return connect(state => { ... })(component); }
then we would could
export default MentorRequired(UserDetail);
etc