Skip to content

Commit

Permalink
Merge pull request #2132 from action-simon/fix/magento-compare-button…
Browse files Browse the repository at this point in the history
…-hover

Fix/magento compare button hover
  • Loading branch information
paales authored Jan 5, 2024
2 parents 5070932 + e090dcb commit f8164a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-rings-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-compare': patch
---

Fix compare button hover state on product page
6 changes: 4 additions & 2 deletions packages/magento-compare/components/CompareProductToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type CompareProductToggleProps = {
function CompareProductToggleBase(
props: CompareProductToggleProps & { inCompareList: boolean; id: string },
) {
const { id, sx, inCompareList, product, color = 'inherit' } = props
const { id, sx, inCompareList, product } = props
const create = useCompareListUidCreate()
const compareList = useCompareSummary()

Expand Down Expand Up @@ -103,9 +103,11 @@ function CompareProductToggleBase(
onMouseDown={preventAnimationBubble}
onTouchStart={preventAnimationBubble}
size='responsive'
color={color}
color='inherit'
sx={[
(theme) => ({
backgroundColor:
theme.palette.mode === 'light' ? theme.palette.background.paper : 'transparent',
flex: `0 0 auto`,
'& svg': {
stroke: strokeColorPlp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function AddCompareToProductPage(props: PluginProps<ProductPageAddToCartRowProps
return (
<Prev {...rest}>
{children}
<CompareProductToggle product={product} color='default' />
<CompareProductToggle product={product} sx={(theme) => ({ boxShadow: theme.shadows[6] })} />
</Prev>
)
}
Expand Down

1 comment on commit f8164a2

@vercel
Copy link

@vercel vercel bot commented on f8164a2 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

graphcommerce-hygraph-dynamic-rows-ui – ./packages/hygraph-dynamic-rows-ui

graphcommerce-hygraph-dynamic-rows-ui.vercel.app
graphcommerce-hygraph-dynamic-rows-ui-git-canary-graphcommerce.vercel.app
graphcommerce-hygraph-dynamic-rows-ui-graphcommerce.vercel.app

Please sign in to comment.