Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/images/ccip-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/images/direct-stacking-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/images/foundry-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions public/images/hardhat-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/images/js-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/npm-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/ts-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/components/ToolsUtilitiesGrid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ToolsUtilitiesGrid

## What it does

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.

## How to use it

1. Import the component in your Astro layout or page:

```astro
import ToolsUtilitiesGrid from "~/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro"
```

2. Create an array of links with the information for each tool/utility you want to display

3. Add the component to your page and pass in the links:

```astro
<ToolsUtilitiesGrid links={yourLinksArray} />
```

## Example

Here's a complete example showing how to use the component:

```astro
---
import ToolsUtilitiesGrid from "~/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro"

const toolsAndUtilities = [
{
image: "/images/ccip-logo.svg",
imageAlt: "CCIP API icon",
label: "CCIP API",
link: "/ccip/api",
description: "An API for message retrieval and lane latency information.",
},
{
image: "/images/js-logo.svg",
imageAlt: "JavaScript SDK icon",
label: "Javascript SDK",
link: "https://github.com/smartcontractkit/ccip-javascript-sdk",
description: "Integrate CCIP functionality directly into your web applications for EVM-compatible chains.",
},
{
image: "/images/hardhat-logo.svg",
imageAlt: "Hardhat icon",
label: "Hardhat Starter Kit",
link: "https://github.com/smartcontractkit/hardhat-starter-kit",
description:
"Ready-to-go boilerplate for basic CCIP use cases that help you get started building quickly with Hardhat.",
},
]
---

<ToolsUtilitiesGrid links={toolsAndUtilities} />
```

## What you need to provide

Each item in your `links` array needs these fields:

| Field | What it is | Example |
| --------------- | ----------------------------------------------------------- | -------------------------------------------------------------- |
| **image** | The full path to the icon/logo image | `"/images/ccip-logo.svg"` |
| **imageAlt** | Description of the image for accessibility | `"CCIP API icon"` |
| **label** | The title/name of the tool or utility | `"CCIP API"` |
| **link** | Where the card should link to (can be internal or external) | `"/ccip/api"` or `"https://github.com/..."` |
| **description** | A short description explaining what the tool does | `"An API for message retrieval and lane latency information."` |

## Where to put images

Place your icon/logo images in the `/public/images/` directory, and reference them with the full path starting with `/images/`.

For example, if you use `image: "/images/my-tool-logo.svg"`, the actual file should be at:

```
/public/images/my-tool-logo.svg
```

You can also use images from other locations by providing the full path (e.g., `"/assets/logos/my-logo.png"`).
28 changes: 28 additions & 0 deletions src/components/ToolsUtilitiesGrid/ToolItem.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
import { Typography } from "@chainlink/blocks"
import styles from "./toolsUtilities.module.css"
import { Link } from "./types"

type Props = Link

const { description, image, imageAlt, label, link } = Astro.props
---

<a href={link} class={styles.card}>
<div class={styles.imageContainer}><img src={image} alt={imageAlt} class={styles.image} /></div>

<div class={styles.content}>
<div>
<Typography
variant="body-semi"
style={{
fontWeight: 500,
fontSize: "18px",
}}>{label}</Typography
>
<Typography variant="body-s" color="muted">{description}</Typography>
</div>

<img src="/assets/icons/upper-right-arrow.svg" class={styles.arrow} />
</div>
</a>
26 changes: 26 additions & 0 deletions src/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
import styles from "./toolsUtilities.module.css"

import { Link } from "./types"
import ToolItem from "./ToolItem.astro"
import { Typography } from "@chainlink/blocks"

interface Props {
links: Link[]
}

const { links } = Astro.props
---

<section class={styles.wrapper}>
<Typography
variant="h2"
style={{
fontSize: "32px",
}}>Tools & Utilities</Typography
>

<div class={styles.container}>
{links.map((link) => <ToolItem {...link} />)}
</div>
</section>
57 changes: 57 additions & 0 deletions src/components/ToolsUtilitiesGrid/toolsUtilities.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.wrapper {
padding: 56px 0;
}
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin-top: var(--space-8x);
}

.card {
padding: var(--space-6x);
display: flex;
gap: var(--space-4x);
align-items: start;
}

.card:hover {
background: var(--muted);
& .arrow {
opacity: 1;
}
}

.imageContainer {
min-width: 48px;
height: 48px;
background: var(--background-alt);
border: 1px solid var(--border);
border-radius: var(--space-1x);
display: flex;
align-items: center;
justify-content: center;
}

.content {
display: flex;

& > img {
align-self: end;
}
}

.arrow {
opacity: 0;
}

@media screen and (max-width: 1135px) {
.container {
grid-template-columns: repeat(2, 1fr);
}
}

@media screen and (max-width: 525px) {
.container {
grid-template-columns: repeat(1, 1fr);
}
}
7 changes: 7 additions & 0 deletions src/components/ToolsUtilitiesGrid/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface Link {
image: string
imageAlt: string
label: string
link: string
description: string
}
59 changes: 59 additions & 0 deletions src/layouts/DocsV3Layout/DocsV3Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as CONFIG from "~/config"
import LeftSidebar from "~/components/LeftSidebar/LeftSidebar.astro"
import PageContent from "~/components/PageContent/PageContent.astro"
import { TabGrid } from "~/components/TabGrid/TabGrid"

import ToolsUtilitiesGrid from "~/components/ToolsUtilitiesGrid/ToolsUtilitiesGrid.astro"
import LayoutHero from "~/components/LayoutHero/LayoutHero.astro"
import ResourceSection from "~/components/Resource/ResourceSection.astro"
import MediaSection from "~/components/MediaSection/MediaSection.astro"
Expand Down Expand Up @@ -41,6 +43,61 @@ const currentPage = new URL(Astro.request.url).pathname

const includeLinkToWalletScript = !!Astro.props.frontmatter.metadata?.linkToWallet

const toolsAndUtilities = [
{
image: "ccip-logo.svg",
imageAlt: "CCIP API icon",
label: "CCIP API",
link: "/ccip/api",
description: "An API for message retrieval and lane latency information.",
},
{
image: "js-logo.svg",
imageAlt: "JavaScript SDK icon",
label: "Javascript SDK",
link: "https://github.com/smartcontractkit/ccip-javascript-sdk",
description: "Integrate CCIP functionality directly into your web applications for EVM-compatible chains.",
},
{
image: "ts-logo.svg",
imageAlt: "CLI icon",
label: "CLI",
link: "https://github.com/smartcontractkit/ccip-tools-ts",
description: "TypeScript command-line interface and library designed for interacting with deployed CCIP contracts.",
},
{
image: "hardhat-logo.svg",
imageAlt: "Hardhat icon",
label: "Hardhat Starter Kit",
link: "https://github.com/smartcontractkit/hardhat-starter-kit",
description:
"Ready-to-go boilerplate for basic CCIP use cases that help you get started building quickly with Hardhat.",
},
{
image: "foundry-logo.svg",
imageAlt: "Foundry icon",
label: "Foundry Starter Kit",
link: "https://github.com/smartcontractkit/foundry-starter-kit",
description:
"Ready-to-go boilerplate for basic CCIP use cases that help you get started building quickly with Foundry.",
},
{
image: "npm-logo.png",
imageAlt: "NPM icon",
label: "CCIP Contracts NPM",
link: "https://www.npmjs.com/package/@chainlink/contracts-ccip",
description:
"An npm package providing Solidity smart contract implementations to integrate CCIP into your EVM-based project.",
},
{
image: "direct-stacking-logo.svg",
imageAlt: "Direct Staking icon",
label: "Direct Staking",
link: "https://github.com/Aphyla/chainlink-csr",
description:
"Stake native tokens on supported L2 networks and receive liquid staked tokens directly on the same chain.",
},
]
// Example resources data
const exampleResources = [
{
Expand Down Expand Up @@ -205,6 +262,7 @@ const quickLinks = [
<LeftSidebar currentPage={currentPage} section={frontmatter.section} />
</aside>
<div id="grid-main">

<LayoutHero
title="Build with CCIP"
description="CCIP makes it simple to move data, messages, and tokens across blockchains. Connect smart contracts on different networks as if they were one system, whether transferring stablecoins, powering cross-chain apps, or running multi-chain DeFi."
Expand All @@ -217,6 +275,7 @@ const quickLinks = [
<TabGrid header="Tutorials" client:visible tabs={exampleTutorials} />
<ResourceSection title="Resources" resources={exampleResources} />
<QuickLinkCard links={quickLinks} />
<ToolsUtilitiesGrid links={toolsAndUtilities} />
<PageContent {titleHeading}>
<TabGrid header="Tutorials" client:visible tabs={exampleTutorials} />
<MediaSection
Expand Down
Loading