-
Notifications
You must be signed in to change notification settings - Fork 63
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/product comparison packages UI components #2594
base: main
Are you sure you want to change the base?
Feat/product comparison packages UI components #2594
Conversation
This reverts commit e283c08.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
Hi team! Thanks for this work ✨
I left a couple suggestions and comments below related to interactions on the PLP page. I'll review the Sidebar
after.
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.
cc: @hellofanny
I don't see this component as a library option. Maybe it could be moved to faststore/core
, what do you think?
packages/ui/src/components/organisms/ProductComparison/styles.scss
Outdated
Show resolved
Hide resolved
packages/components/src/organisms/ProductComparison/ProductComparisonToolbar.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/organisms/ProductComparison/ProductComparisonToolbar.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/organisms/ProductComparison/ProductComparisonToolbar.tsx
Show resolved
Hide resolved
packages/components/src/organisms/ProductComparison/ProductComparisonToolbar.tsx
Outdated
Show resolved
Hide resolved
packages/ui/src/components/organisms/ProductComparison/styles.scss
Outdated
Show resolved
Hide resolved
packages/ui/src/components/organisms/ProductComparison/styles.scss
Outdated
Show resolved
Hide resolved
packages/ui/src/components/organisms/ProductComparison/styles.scss
Outdated
Show resolved
Hide resolved
packages/components/src/organisms/ProductComparison/ProductComparisonToolbar.tsx
Outdated
Show resolved
Hide resolved
<Button variant="tertiary" onClick={() => clearProducts()}> | ||
{clearSelectionButtonLabel} | ||
</Button> |
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.
// Design Tokens for Product Comparison Toolbar | ||
// -------------------------------------------------------- | ||
|
||
// Default properties |
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 a gap between the buttons here, use var(--fs-spacing-2)
bottom: 0; | ||
|
||
padding: var(--fs-spacing-4) var(--fs-spacing-8); | ||
border-top: var(--fs-border-width) solid var(--fs-border-color-light); |
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.
This is not on Figma, please use a box-shadow instead.
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.
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.
div { | ||
display: flex; | ||
align-items: center; | ||
|
||
p { | ||
font-size: var(--fs-text-size-2); | ||
font-weight: var(--fs-product-comparison-text-weight); | ||
margin-right: var(--fs-spacing-3); | ||
} | ||
} |
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.
You can remove this after change it to SelectField
[data-fs-table-head] { | ||
[data-fs-table-row] { | ||
display: flex; | ||
gap: 40px; |
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.
Avoid using absolute values, use the global tokens instead var(--fs-spacing-6)
} | ||
} | ||
|
||
:first-child { |
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.
is this working?
} | ||
} | ||
|
||
:first-child { |
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 think this is working either
This PR includes the construction of the Product Comparison components:
ProductComparison
,ProductComparisonTrigger
,ProductComparisonToolbar
,ProductComparisonSidebar
.In addition to the components, the PR also contains the
ProductComparisonProvider
, which manages all the internal state of the ProductComparison. This provider contains the display condition of theProductComparisonToolbar
, the open and close state of theSlideOver
and the product data to be displayed in theProductComparisonSidebar
. To use theProductComparison
correctly, it is necessary to involve the use of the smaller components previously mentioned with the provider, thus avoiding using them in isolation. There is a validation implemented in theuseProductComparison
hook.The
useProductComparison
hook is responsible for consuming theProductComparisonProvider
and returning all the properties, so that the components in the chain can make use of them. The validation was implemented within this hook.Preview Link: https://starter-b4omfq9wh-vtex.vercel.app/
Printscreens