1
1
import { cn } from '../../cn' ;
2
- import {
3
- FOUR_MAIN_PRODUCTS ,
4
- ProductInfo ,
5
- PRODUCTS ,
6
- SIX_HIGHLIGHTED_PRODUCTS ,
7
- } from '../../products' ;
2
+ import { FOUR_MAIN_PRODUCTS , SIX_HIGHLIGHTED_PRODUCTS } from '../../products' ;
8
3
import { CallToAction } from '../call-to-action' ;
9
- import { HighlightDecoration } from '../decorations' ;
10
4
import { Heading } from '../heading' ;
11
- import { ArrowIcon } from '../icons' ;
12
- import { ReactComponent as HiveDecoration } from './hive-decoration.svg' ;
13
- import { ReactComponent as HiveGatewayDecoration } from './hive-gateway-decoration.svg' ;
14
- import { ReactComponent as MeshDecoration } from './mesh-decoration.svg' ;
15
- import { ReactComponent as YogaDecoration } from './yoga-decoration.svg' ;
5
+ import { AncillaryProductCard , MainProductCard } from '../product-card' ;
16
6
17
- const cardDecorations = {
18
- [ PRODUCTS . HIVE . name ] : HiveDecoration ,
19
- [ PRODUCTS . YOGA . name ] : YogaDecoration ,
20
- [ PRODUCTS . MESH . name ] : MeshDecoration ,
21
- [ PRODUCTS . HIVE_GATEWAY . name ] : HiveGatewayDecoration ,
22
- } ;
23
-
24
- export function ToolsAndLibrariesCards ( { className } : { className ?: string } ) {
7
+ export function ToolsAndLibrariesCards ( {
8
+ className,
9
+ isHive,
10
+ } : {
11
+ className ?: string ;
12
+ isHive ?: boolean ;
13
+ } ) {
25
14
return (
26
15
< section
27
16
className = { cn (
@@ -44,68 +33,12 @@ export function ToolsAndLibrariesCards({ className }: { className?: string }) {
44
33
< AncillaryProductCard key = { product . name } as = "li" product = { product } />
45
34
) ) }
46
35
</ ul >
47
- < CallToAction href = "https://github.com/the-guild-org" variant = "primary" >
36
+ < CallToAction
37
+ href = { isHive ? '/ecosystem' : 'https://the-guild.dev/graphql/hive/ecosystem' }
38
+ variant = "primary"
39
+ >
48
40
Explore the Ecosystem
49
41
</ CallToAction >
50
42
</ section >
51
43
) ;
52
44
}
53
-
54
- export function MainProductCard ( { as : Root , product } : { as : 'div' | 'li' ; product : ProductInfo } ) {
55
- const Decoration = cardDecorations [ product . name ] ;
56
- const Icon = product . logo ;
57
-
58
- return (
59
- < Root
60
- key = { product . name }
61
- className = "hive-focus-within group relative flex-1 shrink-0 basis-[283.5px] overflow-hidden rounded-2xl bg-blue-400 text-green-1000 first-of-type:bg-green-1000 first-of-type:text-white max-md:w-[283.5px]"
62
- >
63
- < a
64
- className = "relative z-10 block flex-1 p-8 outline-none focus-visible:outline-none"
65
- href = { product . href }
66
- >
67
- < p className = "font-medium" > { product . name } </ p >
68
- < Icon className = "mt-8" />
69
- < ArrowIcon className = "absolute bottom-8 right-8" />
70
- </ a >
71
- < Decoration
72
- strokeWidth = "0.5px"
73
- className = "pointer-events-none absolute bottom-0 right-0 fill-blue-200 opacity-0 transition-opacity duration-500 group-first-of-type:fill-blue-700 group-focus-within:opacity-100 group-hover:opacity-100"
74
- preserveAspectRatio = "xMidYMid meet"
75
- />
76
- < 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" />
77
- </ Root >
78
- ) ;
79
- }
80
-
81
- export function AncillaryProductCard ( {
82
- product,
83
- as : Root ,
84
- } : {
85
- product : ProductInfo ;
86
- as : 'div' | 'li' ;
87
- } ) {
88
- const Logo = product . logo ;
89
- return (
90
- < Root
91
- key = { product . name }
92
- className = "hive-focus-within shrink-0 basis-[283.5px] rounded-2xl bg-beige-200 text-green-1000 transition-colors duration-500 hover:bg-beige-400 max-sm:min-w-[283.5px]"
93
- >
94
- < a
95
- href = { product . href }
96
- className = "relative flex h-full flex-col rounded-[inherit] p-8 focus:outline-none focus-visible:outline-none"
97
- >
98
- < p className = "font-medium" > { product . name } </ p >
99
- < p className = "mt-2 text-sm text-green-800" > { product . title } </ p >
100
- < div className = "h-8 grow" />
101
- < div
102
- role = "presentation"
103
- className = "flex size-8 items-center justify-center rounded bg-green-1000 p-[5px] text-sm/5 font-medium text-white"
104
- >
105
- < Logo />
106
- </ div >
107
- < ArrowIcon className = "absolute bottom-8 right-8" />
108
- </ a >
109
- </ Root >
110
- ) ;
111
- }
0 commit comments