Skip to content

Commit e44f13f

Browse files
committed
Links added to cards
1 parent ee2a762 commit e44f13f

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

src/components/Hero/index.jsx

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,34 @@ import Logo from "@assets/GraphScript.png";
1212
import "./style.css";
1313

1414
export function Hero() {
15+
const actions = [
16+
{
17+
name: "Get Ecosystem",
18+
icon: Trees,
19+
href: "https://github.com/GraphScript-Labs/",
20+
},
21+
{
22+
name: "GSAM Compiler",
23+
icon: Drill,
24+
href: "https://github.com/GraphScript-Labs/gsam-compiler",
25+
},
26+
{
27+
name: "Online Editor",
28+
icon: ToolCase,
29+
href: "https://graphscript-labs.github.io/editor",
30+
},
31+
{
32+
name: "Documentation",
33+
icon: LibraryBig,
34+
href: "https://graphscript-labs.github.io/docs",
35+
},
36+
{
37+
name: "Open Source",
38+
icon: FolderGit2,
39+
href: "https://github.com/GraphScript-Labs",
40+
},
41+
];
42+
1543
return (<>
1644
<div className="hero">
1745
<div className="content">
@@ -26,11 +54,13 @@ export function Hero() {
2654
</div>
2755
</div>
2856
<div className="actions">
29-
<HeroCard name="Get Ecosystem" icon={Trees} />
30-
<HeroCard name="GSAM Compiler" icon={Drill} />
31-
<HeroCard name="Online Editor" icon={ToolCase} />
32-
<HeroCard name="Documentation" icon={LibraryBig} />
33-
<HeroCard name="Source Code" icon={FolderGit2} />
57+
{
58+
actions.map((action, index) => <HeroCard
59+
key={index}
60+
{...action}
61+
/>
62+
)
63+
}
3464
</div>
3565
</div>
3666
</>);

src/components/HeroCard/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { MoveUpRight } from "lucide-react";
22
import "./style.css";
33

4-
export function HeroCard({ name, icon }) {
4+
export function HeroCard({ name, icon, href }) {
55
const CardIcon = icon;
66

7+
const openLink = () => {
8+
if (!href) return;
9+
window.open(href, "_blank");
10+
};
11+
712
return (<>
8-
<div className="hero-card">
13+
<div className="hero-card" onClick={openLink}>
914
<div className="hero-card-icon-container">
1015
<CardIcon className="hero-card-icon" />
1116
</div>

0 commit comments

Comments
 (0)