@hanzo/commerce 6.1.4 → 6.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,8 +57,7 @@ const BuyDrawer: React.FC<{
|
|
|
57
57
|
{trigger}
|
|
58
58
|
</DrawerTrigger>
|
|
59
59
|
<DrawerContent
|
|
60
|
-
className={cn('rounded-t-xl
|
|
61
|
-
overlayClx='z-[51]'
|
|
60
|
+
className={cn('rounded-t-xl mt-6 pb-12 h-auto min-h-[35vh] pt-6 md:max-w-[550px] md:mx-auto', drawerClx)}
|
|
62
61
|
>
|
|
63
62
|
<BuyCard
|
|
64
63
|
skuPath={skuPath}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/commerce",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.6",
|
|
4
4
|
"description": "Library with shopping cart components.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"square": "^35.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@hanzo/auth": "^2.3.
|
|
43
|
-
"@hanzo/ui": "^3.
|
|
42
|
+
"@hanzo/auth": "^2.3.4",
|
|
43
|
+
"@hanzo/ui": "^3.4.1",
|
|
44
44
|
"@hookform/resolvers": "^3.3.4",
|
|
45
45
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
46
46
|
"firebase": "^10.8.0",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React, {useState, type PropsWithChildren} from 'react'
|
|
3
|
-
|
|
4
|
-
import { X } from 'lucide-react'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Popover,
|
|
8
|
-
PopoverContent,
|
|
9
|
-
PopoverTrigger,
|
|
10
|
-
PopoverClose
|
|
11
|
-
} from "@hanzo/ui/primitives"
|
|
12
|
-
|
|
13
|
-
import { cn } from '@hanzo/ui/util'
|
|
14
|
-
|
|
15
|
-
import BuyCard from './buy-item-card'
|
|
16
|
-
|
|
17
|
-
const BuyPopup: React.FC<PropsWithChildren & {
|
|
18
|
-
skuPath: string
|
|
19
|
-
triggerClx?: string
|
|
20
|
-
popupClx?: string
|
|
21
|
-
cardClx?: string
|
|
22
|
-
}> = ({
|
|
23
|
-
skuPath,
|
|
24
|
-
children,
|
|
25
|
-
triggerClx='',
|
|
26
|
-
popupClx='',
|
|
27
|
-
cardClx='',
|
|
28
|
-
}) => {
|
|
29
|
-
|
|
30
|
-
const [open, setOpen] = useState<boolean>(false)
|
|
31
|
-
|
|
32
|
-
const onQuantityChanged = (sku: string, oldV: number, newV: number) => {
|
|
33
|
-
if (oldV === 0 && newV === 1) {
|
|
34
|
-
setTimeout(() => {setOpen(false)}, 150)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
40
|
-
<PopoverTrigger asChild className={triggerClx}>
|
|
41
|
-
{children}
|
|
42
|
-
</PopoverTrigger>
|
|
43
|
-
<PopoverContent className={cn('relative flex flex-col p-0 px-4 pb-4 pt-2', popupClx)}>
|
|
44
|
-
<PopoverClose className='absolute z-20 right-2 top-2 self-end hover:bg-level-3 text-muted hover:text-accent p-1 rounded-full'><X className='w-5 h-5'/></PopoverClose>
|
|
45
|
-
<BuyCard skuPath={skuPath} onQuantityChanged={onQuantityChanged} className={cn("w-full relative ", cardClx)}/>
|
|
46
|
-
</PopoverContent>
|
|
47
|
-
</Popover>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default BuyPopup
|