-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feat/create typography components + nextjs image component #45
base: master
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/rtcamp/wp-decoupled/8bzphkrsj [Deployment for 02f6729 failed] |
pages/index.js
Outdated
<NextImage | ||
className="product-image" | ||
src={item.image.sourceUrl} | ||
alt={item.name} |
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.
Change to item?.image?.sourceUrl
pages/index.js
Outdated
height="240" | ||
/> | ||
<h5 className="product-name">{item.name}</h5> | ||
<Paragraph className="product-price">{item.price}</Paragraph> |
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.
Add optional chaining at all places
item?.price
{userData.user.email ? <p>Email: {userData.user.email}</p> : ''} | ||
{userData.user.email ? | ||
<Paragraph>Email: {userData.user.email}</Paragraph> : '' | ||
} |
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.
Use null instead of empty string
src={item.image.sourceUrl} | ||
srcSet={item.image.srcSet} | ||
alt={item.image.title} | ||
width="64" | ||
height="64" |
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.
please add sizes attribute, else srcSet won't work
https://css-tricks.com/responsive-images-css/#sizes-in-css
</a> | ||
</Link> | ||
</li> | ||
<li className="product-category product last col-md-4"> | ||
<Link as={`/`} href={`/`}> | ||
<a className=""> | ||
<img | ||
<NextImage | ||
src="https://woo-vsf.dev5.rt.gw/wp-content/uploads/2019/05/tshirts.jpg" | ||
alt="Tshirts" | ||
width="324" | ||
height="324" | ||
srcSet="https://woo-vsf.dev5.rt.gw/wp-content/uploads/2019/05/tshirts.jpg 801w, https://woo-vsf.dev5.rt.gw/wp-content/uploads/2019/05/tshirts-150x150.jpg 150w, https://woo-vsf.dev5.rt.gw/wp-content/uploads/2019/05/tshirts-300x300.jpg 300w, https://woo-vsf.dev5.rt.gw/wp-content/uploads/2019/05/tshirts-768x768.jpg 768w" | ||
sizes="(max-width: 324px) 100vw, 324px" |
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.
Lets not keep this hardcoded
Can we do queries for categories please and fetch?
If we plan to do it later, can we add a @todo and raise a Github issue please
@@ -0,0 +1,20 @@ | |||
export const Heading = (props) => { | |||
const { className, children } = props; |
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 we do an early return if children is not available 🔢
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.
Added a few comments
-Note: Add SITE_DOMAIN='YOUR_DOMAIN' in env file.