1
1
import { useId } from 'react' ;
2
2
import { cn } from '../../cn' ;
3
3
import { FOUR_MAIN_PRODUCTS , ProductInfo , PRODUCTS } from '../../products' ;
4
- import { HighlightDecoration } from '../decorations' ;
4
+ import { DecorationIsolation , HighlightDecoration } from '../decorations' ;
5
5
import { ArrowIcon } from '../icons' ;
6
6
import { ReactComponent as HiveDecoration } from './hive-decoration.svg' ;
7
7
import { ReactComponent as HiveGatewayDecoration } from './hive-gateway-decoration.svg' ;
@@ -25,7 +25,7 @@ export function MainProductCard({ as: Root, product, className, ...rest }: Produ
25
25
return (
26
26
< Root
27
27
className = { cn (
28
- 'hive-focus-within group relative flex-1 shrink-0 basis-[283.5px] overflow-hidden rounded-2xl max-md:w-[283.5px]' ,
28
+ 'hive-focus-within group relative flex-1 shrink-0 basis-[283.5px] overflow-hidden rounded-2xl max-md:min- w-[283.5px]' ,
29
29
isHive ? 'bg-green-1000 text-white' : 'bg-blue-400 text-green-1000' ,
30
30
className ,
31
31
) }
@@ -38,36 +38,45 @@ export function MainProductCard({ as: Root, product, className, ...rest }: Produ
38
38
< p className = "font-medium" > { product . name } </ p >
39
39
< Icon className = "mt-8" />
40
40
< ArrowIcon className = "absolute bottom-8 right-8" />
41
- </ a >
42
- < Decoration
43
- strokeWidth = "0.5px"
44
- className = { cn (
45
- 'stroke-white/70' ,
46
- 'pointer-events-none absolute bottom-0 right-0 h-full opacity-0 transition-opacity duration-500 group-focus-within:opacity-100 group-hover:opacity-100' ,
47
- ) }
48
- fill = { `url(#${ id } )` }
49
- />
50
- < svg
51
- // To remove from layout, but we can't use `display: none` because it breaks the gradient
52
- className = "size-0"
53
- >
54
- < defs >
55
- < linearGradient id = { id } x1 = "1" y1 = "2" x2 = "161" y2 = "171" gradientUnits = "userSpaceOnUse" >
56
- { isHive ? (
57
- < >
58
- < stop stopColor = "#3b736a" />
59
- < stop offset = "1" stopColor = "#245850" />
60
- </ >
61
- ) : (
62
- < >
63
- < stop stopColor = "white" stopOpacity = "0.1" />
64
- < stop offset = "1" stopColor = "white" stopOpacity = "0.4" />
65
- </ >
41
+ < DecorationIsolation >
42
+ < Decoration
43
+ strokeWidth = "0.5px"
44
+ className = { cn (
45
+ 'stroke-white/70' ,
46
+ 'pointer-events-none absolute bottom-0 right-0 h-full opacity-0 transition-opacity duration-500 group-focus-within:opacity-100 group-hover:opacity-100' ,
66
47
) }
67
- </ linearGradient >
68
- </ defs >
69
- </ svg >
70
- < HighlightDecoration className = "pointer-events-none absolute left-0 top-[-15%] h-[150%] w-full opacity-0 transition-opacity duration-1000 group-focus-within:opacity-100 group-hover:opacity-100" />
48
+ fill = { `url(#${ id } )` }
49
+ />
50
+ < svg
51
+ // To remove from layout, but we can't use `display: none` because it breaks the gradient
52
+ className = "size-0"
53
+ >
54
+ < defs >
55
+ < linearGradient
56
+ id = { id }
57
+ x1 = "1"
58
+ y1 = "2"
59
+ x2 = "161"
60
+ y2 = "171"
61
+ gradientUnits = "userSpaceOnUse"
62
+ >
63
+ { isHive ? (
64
+ < >
65
+ < stop stopColor = "#3b736a" />
66
+ < stop offset = "1" stopColor = "#245850" />
67
+ </ >
68
+ ) : (
69
+ < >
70
+ < stop stopColor = "white" stopOpacity = "0.1" />
71
+ < stop offset = "1" stopColor = "white" stopOpacity = "0.4" />
72
+ </ >
73
+ ) }
74
+ </ linearGradient >
75
+ </ defs >
76
+ </ svg >
77
+ < HighlightDecoration className = "pointer-events-none absolute left-0 top-[-15%] h-[150%] w-full opacity-0 transition-opacity duration-1000 group-focus-within:opacity-100 group-hover:opacity-100" />
78
+ </ DecorationIsolation >
79
+ </ a >
71
80
</ Root >
72
81
) ;
73
82
}
0 commit comments