Skip to content

Commit f140ca8

Browse files
Feat/110 tools utilities (#116)
* add grid * Update DocsV3Layout.astro * Update DocsV3Layout.astro * rwd * Update DocsV3Layout.astro * Update DocsV3Layout.astro * Update ToolsUtilitiesGrid.astro * add readme --------- Co-authored-by: Simone Cuomo <simone@thisdot.co>
1 parent ae1893f commit f140ca8

13 files changed

Lines changed: 310 additions & 0 deletions

File tree

public/images/ccip-logo.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

public/images/foundry-logo.svg

Lines changed: 11 additions & 0 deletions
Loading

public/images/hardhat-logo.svg

Lines changed: 20 additions & 0 deletions
Loading

public/images/js-logo.svg

Lines changed: 4 additions & 0 deletions
Loading

public/images/npm-logo.png

493 Bytes
Loading

public/images/ts-logo.svg

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# ToolsUtilitiesGrid
2+
3+
## What it does
4+
5+
This component displays a grid of clickable cards that showcase tools and utilities. Each card includes an icon, title, description, and link. It's perfect for creating a visual directory of resources, tools, or utilities that users can browse and click through to.
6+
7+
## How to use it
8+
9+
1. Import the component in your Astro layout or page:
10+
11+
```astro
12+
import ToolsUtilitiesGrid from "~/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro"
13+
```
14+
15+
2. Create an array of links with the information for each tool/utility you want to display
16+
17+
3. Add the component to your page and pass in the links:
18+
19+
```astro
20+
<ToolsUtilitiesGrid links={yourLinksArray} />
21+
```
22+
23+
## Example
24+
25+
Here's a complete example showing how to use the component:
26+
27+
```astro
28+
---
29+
import ToolsUtilitiesGrid from "~/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro"
30+
31+
const toolsAndUtilities = [
32+
{
33+
image: "/images/ccip-logo.svg",
34+
imageAlt: "CCIP API icon",
35+
label: "CCIP API",
36+
link: "/ccip/api",
37+
description: "An API for message retrieval and lane latency information.",
38+
},
39+
{
40+
image: "/images/js-logo.svg",
41+
imageAlt: "JavaScript SDK icon",
42+
label: "Javascript SDK",
43+
link: "https://github.com/smartcontractkit/ccip-javascript-sdk",
44+
description: "Integrate CCIP functionality directly into your web applications for EVM-compatible chains.",
45+
},
46+
{
47+
image: "/images/hardhat-logo.svg",
48+
imageAlt: "Hardhat icon",
49+
label: "Hardhat Starter Kit",
50+
link: "https://github.com/smartcontractkit/hardhat-starter-kit",
51+
description:
52+
"Ready-to-go boilerplate for basic CCIP use cases that help you get started building quickly with Hardhat.",
53+
},
54+
]
55+
---
56+
57+
<ToolsUtilitiesGrid links={toolsAndUtilities} />
58+
```
59+
60+
## What you need to provide
61+
62+
Each item in your `links` array needs these fields:
63+
64+
| Field | What it is | Example |
65+
| --------------- | ----------------------------------------------------------- | -------------------------------------------------------------- |
66+
| **image** | The full path to the icon/logo image | `"/images/ccip-logo.svg"` |
67+
| **imageAlt** | Description of the image for accessibility | `"CCIP API icon"` |
68+
| **label** | The title/name of the tool or utility | `"CCIP API"` |
69+
| **link** | Where the card should link to (can be internal or external) | `"/ccip/api"` or `"https://github.com/..."` |
70+
| **description** | A short description explaining what the tool does | `"An API for message retrieval and lane latency information."` |
71+
72+
## Where to put images
73+
74+
Place your icon/logo images in the `/public/images/` directory, and reference them with the full path starting with `/images/`.
75+
76+
For example, if you use `image: "/images/my-tool-logo.svg"`, the actual file should be at:
77+
78+
```
79+
/public/images/my-tool-logo.svg
80+
```
81+
82+
You can also use images from other locations by providing the full path (e.g., `"/assets/logos/my-logo.png"`).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
import { Typography } from "@chainlink/blocks"
3+
import styles from "./toolsUtilities.module.css"
4+
import { Link } from "./types"
5+
6+
type Props = Link
7+
8+
const { description, image, imageAlt, label, link } = Astro.props
9+
---
10+
11+
<a href={link} class={styles.card}>
12+
<div class={styles.imageContainer}><img src={image} alt={imageAlt} class={styles.image} /></div>
13+
14+
<div class={styles.content}>
15+
<div>
16+
<Typography
17+
variant="body-semi"
18+
style={{
19+
fontWeight: 500,
20+
fontSize: "18px",
21+
}}>{label}</Typography
22+
>
23+
<Typography variant="body-s" color="muted">{description}</Typography>
24+
</div>
25+
26+
<img src="/assets/icons/upper-right-arrow.svg" class={styles.arrow} />
27+
</div>
28+
</a>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
import styles from "./toolsUtilities.module.css"
3+
4+
import { Link } from "./types"
5+
import ToolItem from "./ToolItem.astro"
6+
import { Typography } from "@chainlink/blocks"
7+
8+
interface Props {
9+
links: Link[]
10+
}
11+
12+
const { links } = Astro.props
13+
---
14+
15+
<section class={styles.wrapper}>
16+
<Typography
17+
variant="h2"
18+
style={{
19+
fontSize: "32px",
20+
}}>Tools & Utilities</Typography
21+
>
22+
23+
<div class={styles.container}>
24+
{links.map((link) => <ToolItem {...link} />)}
25+
</div>
26+
</section>

0 commit comments

Comments
 (0)