-
Notifications
You must be signed in to change notification settings - Fork 687
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
Implement contact information, addresses, newsletter sections on account details page #570
Conversation
This pull request is automatically deployed with Now. |
d063eaf
to
8ac93c1
Compare
e10fd4f
to
0a4afdf
Compare
458aa69
to
93f3e41
Compare
93f3e41
to
8c57f6a
Compare
8c57f6a
to
eabf364
Compare
Hold until #541 is merged. |
packages/venia-concept/src/components/MyAccount/AddressBlock/__tests__/addressBlock.spec.js
Outdated
Show resolved
Hide resolved
user: { | ||
currentUser: { addresses } | ||
} | ||
}) => addresses.find(({ default_shipping }) => default_shipping); |
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.
Is this just a boolean prop? If so this is fine, otherwise it would just return the first default_shipping
prop it finds.
} | ||
}) => addresses.find(({ default_billing }) => default_billing); | ||
|
||
export const getCurrentUser = ({ user: { currentUser } }) => currentUser; |
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.
Can this be replaced by getUserInformation
? Seems to be doing almost identical things though getUserInformation
returns a subset of the entire currentUser
props.
title: PropTypes.string | ||
}), | ||
customer: PropTypes.shape({}), | ||
addresses: PropTypes.arrayOf(PropTypes.shape({})) |
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.
Should add user
to this propTypes object.
packages/venia-concept/src/components/MyAccount/__tests__/myAccount.spec.js
Outdated
Show resolved
Hide resolved
title: PropTypes.string | ||
}), | ||
title: PropTypes.node, | ||
rightTitle: PropTypes.node, |
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.
What is rightTitle
? Is this similar to the badge we discussed in the previous PR?
import classify from 'src/classify'; | ||
import defaultClasses from './separator.css'; | ||
|
||
class Separator extends Component { |
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.
Does this really need to be a class? Can we just hide the last item with css?
...nia-concept/src/components/MyAccount/ContactInformation/__tests__/contactInformation.spec.js
Outdated
Show resolved
Hide resolved
import classify from 'src/classify'; | ||
import defaultClasses from './actionButton.css'; | ||
|
||
class ActionButton extends Component { |
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 think we don't need this. We have a button component now.
export const getCountryName = (countries, countryId) => { | ||
const country = countries.find(country => country.id === countryId); | ||
|
||
return country ? country.full_name_locale : ''; |
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.
Do we really want to return empty string here? What's the format for this data? Is there a safer fallback we can use or maybe just something like COUNTRY_NAME_UNKNOWN
?
Closing for now. See #514 for information. |
This PR is a:
[x] New feature
[ ] Enhancement/Optimization
[ ] Refactor
[ ] Bugfix
[ ] Test for existing code
[ ] Documentation
Summary
When this pull request is merged, it will add my account page. Only contact information, addresses and newsletter sections was added #514.
Additional information