-
Notifications
You must be signed in to change notification settings - Fork 281
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
Refactor the product detail page and the cart #2132
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
c016743
to
f6df8a9
Compare
This comment has been minimized.
This comment has been minimized.
6f40686
to
d821a68
Compare
@@ -8,7 +8,7 @@ import type { | |||
import {Aside} from '~/components/Aside'; | |||
import {Footer} from '~/components/Footer'; | |||
import {Header, HeaderMenu} from '~/components/Header'; | |||
import {CartMain} from '~/components/Cart'; | |||
import {CartMain} from '~/components/CartMain'; |
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 don't love the name CartMain
— but not sure what else it should be
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.
overall nice changes — it's nice how much simpler it is, I really like how much less indirection there is on the PDP especially — and then componentizing cart can in the future be quite valuable
@@ -309,6 +309,7 @@ export function PredictiveSearchForm({ | |||
{...props} | |||
className={className} | |||
onSubmit={(event) => { | |||
debugger; |
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.
@blittle We probably don't want this 😅
@@ -93,7 +93,7 @@ export default function Cart() { | |||
errorElement={<div>An error occurred</div>} | |||
> | |||
{(cart) => { | |||
return <CartMain layout="page" cart={cart} />; | |||
return <CartMain layout="page" cart={cart!} />; |
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.
Maybe we should make CartMain
get cart: Cart | null
instead of adding !
everywhere?
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.
but what if Bret just really wants to put a lot of emphasis on cart
? ;)
We want to refactor the starter template, moving things around while maintaining existing functionality. The hope is to make the code more self documenting and easy to understand.
Things to include