Skip to content
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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bilouStrike
Copy link
Contributor

  • Create typography components like:
    • Heading for H1,
    • SubHeading for H2
    • Paragraph for

  • Add Next.js Image component.
    -Note: Add SITE_DOMAIN='YOUR_DOMAIN' in env file.

@vercel
Copy link

vercel bot commented Jan 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rtcamp/wp-decoupled/8bzphkrsj
✅ Preview: Failed

[Deployment for 02f6729 failed]

pages/index.js Outdated
<NextImage
className="product-image"
src={item.image.sourceUrl}
alt={item.name}
Copy link
Contributor

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>
Copy link
Contributor

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> : ''
}
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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;
Copy link
Contributor

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 🔢

Copy link
Contributor

@imranhsayed imranhsayed left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants