gil-- / gatsby-starter-shopifypwa

💚:shopping_cart:💚 Bodega is a Shopify PWA using Gatsby JS + Netlify CMS
https://bodega.netlify.com
MIT License
103 stars 9 forks source link

Auth Wrapper Refactoring #32

Closed gil-- closed 5 years ago

gil-- commented 5 years ago

Refactored the AuthenticationWrapper component to use a render prop instead of the messy prop situation that was before.

For the GuestLayout, it can honestly be folded into AccountLayout component and simply pass isGuest or isCustomer booleans (<AccountLayout isGuest={true}> or <AccountLayout isCustomer={true} to handle the redirect logic since they are essentially the same with only a redirect and inverse logic. For now, I'll leave as is.

TODO: add missing PropTypes validation to all components.