-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show profile image for logged in user #111
Conversation
@adamstankiewicz @georgebabey This is a new PR. Initial review was completed at #106. Needs your final review. |
c9df25c
to
e84bb23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - just one small fix in the header propTypes/defaultProps
src/components/Header/index.jsx
Outdated
@@ -50,12 +66,18 @@ Header.propTypes = { | |||
enterpriseLogo: PropTypes.string, | |||
enterpriseName: PropTypes.string, | |||
email: PropTypes.string, | |||
username: PropTypes.string, | |||
fetchUserProfile: () => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like propTypes
and defaultProps
are reversed for fetchUserProfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one comment from me as well regarding one of the tests for the profile image.
profile: { | ||
profile_image: { | ||
has_image: true, | ||
image_url_medium: 'https://raw.githubusercontent.com/edx/edx-portal/master/src/images/edx-logo.png', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should import this image instead of using the url from Github. Don't know if I trust a https://raw.githubusercontent.com link will always stick around.
Related, the test name could just say "renders profile image correctly" as we don't really care if it's an external image or not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mention it as its a) in a test and b) I don't think it will actually fetch the image, would just render the snapshot with a reference to it so if it was no longer there the test would pass. But it might not hurt to make it obvious its a dummy url like https://path-to-profile-image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true it wouldn't actually be fetching the image in the snapshot, in which case a dummy URL would work.
But, if we decide to eventually use visual regression testing/diffing, it would be fetched so we might as well import and use the actual edx-logo.png
image here.
e84bb23
to
706c18d
Compare
@adamstankiewicz @georgebabey Addressed the feedback. Please continue the review. |
ENT-1104