chec / commercejs-nextjs-demo-store

Commerce demo store built for the Jamstack. Built with Commerce.js, Next.js, and can be one-click deployed to Netlify. Includes product catalog, customer login, categories, variants, cart, checkout, payments (Stripe) order confirmation, and printable receipts.
https://commercejs-demo-store.netlify.app/
BSD 3-Clause "New" or "Revised" License
1.07k stars 206 forks source link

[CHEC-1009] Customer account page #149

Closed kvisca closed 3 years ago

kvisca commented 3 years ago

Adding a customer's account page with an individual order view page.

Account Page Screen Shot 2020-11-18 at 4 27 02 PM

Order Page Screen Shot 2020-11-18 at 4 26 45 PM

linear[bot] commented 3 years ago
CHEC-1009 Build a customer's home page

After a user has logged in they'll be sent to this page. We can show some super basic information such as: * Their name and email address * A list of their orders These are available from the following APIs: * `GET /v1/customers/{customer_id}` * `GET /v1/customers/{customer_id}/orders` Both of those APIs require knowledge of the customer ID, which is returned in the login handler (CHEC-1008), and the customer JWT which is also returned in that task. We can probably store these in session storage or something… cc @guy

robbieaverill commented 3 years ago

A couple of minor things from your screenshots: can you use sentence casing, and your dates don't look like they're being parsed correctly

robbieaverill commented 3 years ago

I've rebased locally this onto #152 in order to test it because we broke things. Some feedback:

There are also a couple of console errors on this page for me:

image image

I don't think this is related to this PR specifically, but I think we should change the "Logout" link in the top right header when you're logged in to "Account" which sends you to your account, then put the Logout link somewhere on the account page:

robbieaverill commented 3 years ago

Hey @kvisca, still a few things:

Functionally, I notice that every click from "My account" to an order, back again, to another order etc, reloads everything in Redux (categories, products, cart). This is definitely not ideal.

Good news is this looks good on mobile!

kvisca commented 3 years ago

@robbieaverill Thanks for the feedback, should be good to go now. Let me know if you catch anything else!

robbieaverill commented 3 years ago

@kvisca:

I haven't reviewed the code at all yet, only UI so far.

kvisca commented 3 years ago

I haven't reviewed the code at all yet, only UI so far.

Thanks, @robbieaverill. I've updated as requested.

robbieaverill commented 3 years ago

Still getting this: image

customerAccountPage has customer: {} in props. Otherwise I can't see where this would come from.

This shows when I first log in. I can navigate into an order view and back again and it will still show. When I refresh the page it renders the date correctly. At that point the customer object in props contains my information.

Functionally, I notice that every click from "My account" to an order, back again, to another order etc, reloads everything in Redux (categories, products, cart). This is definitely not ideal.

This is still happening

kvisca commented 3 years ago

Lots of these comments are about linting. Please make sure you lint your code (yarn lint).

Just so you're aware, yarn lint doesn't catch any of this on this project.

robbieaverill commented 3 years ago

Cool, I'll update the linting rules later. In the meantime please take advantage of the human linting results above 😄

kvisca commented 3 years ago

Cool, I'll update the linting rules later. In the meantime please take advantage of the human linting results above 😄

Much appreciated 👍

robbieaverill commented 3 years ago

Nice work. We can address any outstanding issues in new PRs in future 👍