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/assets/icons/Arrow Right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/assets/icons/remix-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/assets/icons/token-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/components/Cards/Card.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import CardLink from "./CardLink.astro"
import styles from "./cards.module.css"
import { ICard } from "./types"

type Props = ICard

const { title, description, links } = Astro.props
---

<div class={styles.card}>
<p class={styles.cardTitle}>{title}</p>
<p>{description}</p>
<div class={styles.links}>
{links && links.map((l) => <CardLink link={l} />)}
</div>
</div>
27 changes: 27 additions & 0 deletions src/components/Cards/CardLink.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
import styles from "./cards.module.css"
import { ILink } from "./types"

import tokenIcon from "../../assets/icons/token-icon.svg"
import remixIcon from "../../assets/icons/remix-logo.svg"

interface Props {
link: ILink
}

const { link } = Astro.props

const iconMap = {
token: tokenIcon,
remix: remixIcon,
}

const iconSrc = iconMap[link.icon]
---

<a href={link.href} class={styles.link}>
<img src={iconSrc.src} alt="" />

<span>{link.label}</span>
<img src="/assets/icons/Arrow Right.svg" alt="arrow right" />
</a>
15 changes: 15 additions & 0 deletions src/components/Cards/CardsWrapper.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
import Card from "./Card.astro"
import styles from "./cards.module.css"
import { ICard } from "./types.ts"

interface Props {
links: ICard[]
}

const { links } = Astro.props
---

<section class={styles.cardsWrapper}>
{links.map((link) => <Card title={link.title} description={link.description} links={link.links} />)}
</section>
65 changes: 65 additions & 0 deletions src/components/Cards/cards.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.cardsWrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
border-left: 1px solid var(--border);
border-top: 1px solid var(--border);
}

.cardsWrapper h6 {
font-size: 18px;
margin-bottom: var(--space-4x);
}

:where(.cardsWrapper p) {
font-size: 14px;
line-height: 24px; /* 171.429% */
}

.card {
padding: var(--space-5x) var(--space-6x);
background: #fff;
border-right: 1px solid var(--border);
border-bottom: 1px solid var(--border);
}

.card:hover {
background: var(--gray-100);
}

.links {
display: flex;
flex-direction: column;
margin-top: var(--space-6x);
gap: var(--space-4x);
}

.link {
color: var(--Color-Primary, #0e1119);
display: flex;
gap: var(--space-2x);
align-items: center;
cursor: default;
}

.link:hover span {
opacity: 0.7;
}

.cardTitle {
font-weight: 525;
margin-bottom: var(--space-4x);
font-size: 18px;
color: var(--foreground);
}

@media screen and (max-width: 768px) {
.cardsWrapper {
grid-template-columns: repeat(2, 1fr) !important;
}
}

@media screen and (max-width: 425px) {
.cardsWrapper {
grid-template-columns: repeat(1, 1fr) !important;
}
}
12 changes: 12 additions & 0 deletions src/components/Cards/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export type IconType = "token" | "remix"

export interface ILink {
icon: IconType
href: string
label: string
}
export interface ICard {
title: string
description: string
links?: ILink[]
}
1 change: 1 addition & 0 deletions src/components/PageContent/PageContent.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const { titleHeading } = Astro.props

<article id="article">
<h1 id={titleHeading.slug}>{titleHeading.text}</h1>

<slot />
</article>

Expand Down
1 change: 1 addition & 0 deletions src/layouts/DocsLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import StickyHeader from "~/components/StickyHeader/StickyHeader"
import BaseLayout from "./BaseLayout.astro"
import { VersionSelector } from "~/components/VersionSelector/index.js"
import { detectApiReference } from "@components/VersionSelector/utils/versions"
import CardsWrapper from "~/components/Cards/CardsWrapper.astro"

interface Props {
frontmatter: BaseFrontmatter
Expand Down
4 changes: 3 additions & 1 deletion src/pages/ccip/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ if (!entry) {
const { Content, headings } = await render(entry)
---

<DocsV3Layout frontmatter={entry.data} {headings} />
<DocsV3Layout frontmatter={entry.data} {headings}>
<Content />
</DocsV3Layout>
55 changes: 53 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,61 @@
---
import ProductTabs from "../features/landing/sections/ProductTabs.astro"
import LandingLayout from "../layouts/LandingLayout.astro"
import HeroCTA from "../features/landing/sections/HeroCTA.astro"
import BaseLayout from "~/layouts/BaseLayout.astro"

import * as CONFIG from "../config"
import CardsWrapper from "~/components/Cards/CardsWrapper.astro"
import type { ICard } from "~/components/Cards/types"

const formattedContentTitle = `${CONFIG.PAGE.titleFallback} | ${CONFIG.SITE.title}`

const sample: ICard[] = [
{
title: "Deploy/enable a token across multiple chains",
description:
"Create a new Cross-Chain-Token or enable an established one that can be launched on 50+ chains, providing unparalleled interoperability and reach.",
links: [
{
icon: "token",
href: "https://example.com",
label: "View Token Manager",
},
{
icon: "remix",
href: "https://example.com",
label: "Open in Remix",
},
],
},
{
title: "Bridge a token",
description:
"Securely transfer tokens - including ETH, USDC, LINK - and messages between different blockchain networks.",
links: [
{
icon: "token",
href: "https://example.com",
label: "View Token Manager",
},
{
icon: "remix",
href: "https://example.com",
label: "Open in Remix",
},
],
},
{
title: "Send a token with data",
description:
"Build token transfers that do more than move value, letting you embed business logic directly into your cross-chain workflows.",
links: [
{
icon: "remix",
href: "https://example.com",
label: "Open in Remix",
},
],
},
]
---

<BaseLayout title={formattedContentTitle}>
Expand All @@ -15,6 +64,8 @@ const formattedContentTitle = `${CONFIG.PAGE.titleFallback} | ${CONFIG.SITE.titl
<div class="hero">
<h1>Chainlink Developer Docs</h1>
<h2>What are you building?</h2>
<CardsWrapper links={sample} />

<ProductTabs />
</div>
</div>
Expand Down
Loading