Skip to content

Commit e761a90

Browse files
committed
Add AddButton component and integrate it into Chain and CCIP landing pages; include add icon SVG and update theme styles for consistency
1 parent 5cc9dd8 commit e761a90

File tree

5 files changed

+54
-10
lines changed

5 files changed

+54
-10
lines changed

public/assets/icons/add.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
export interface Props {
3+
href: string
4+
text: string
5+
}
6+
7+
const { href, text } = Astro.props
8+
---
9+
10+
<a class="add-button" href={href}>
11+
<img src="/assets/icons/add.svg" alt="Add" class="add-button-icon" />
12+
{text}
13+
</a>
14+
15+
<style>
16+
.add-button {
17+
display: inline-flex;
18+
align-items: center;
19+
gap: 8px;
20+
padding: var(--space-2x) var(--space-4x);
21+
border: 1px solid var(--tertiary-border);
22+
border-radius: 4px;
23+
font-family: "Inter", sans-serif;
24+
font-size: 12px;
25+
font-weight: 600;
26+
line-height: 16px;
27+
color: var(--tertiary-foreground);
28+
text-decoration: none;
29+
background-color: transparent;
30+
transition: all 0.2s ease;
31+
}
32+
33+
.add-button:hover {
34+
background-color: var(--gray-100);
35+
border-color: var(--gray-400);
36+
}
37+
38+
.add-button-icon {
39+
width: 12px;
40+
height: 12px;
41+
}
42+
</style>

src/components/CCIP/Chain/Chain.astro

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import ChainTokenGrid from "./ChainTokenGrid"
1717
import { generateChainStructuredData } from "~/utils/ccipStructuredData"
1818
import StructuredData from "~/components/StructuredData.astro"
1919
import { DOCS_BASE_URL } from "~/utils/structuredData"
20+
import AddButton from "~/components/CCIP/AddButton/AddButton.astro"
2021
2122
interface Props {
2223
environment: Environment
@@ -128,14 +129,7 @@ const chainStructuredData = generateChainStructuredData(
128129
<h2>Tokens <span>({allTokens.length})</span></h2>
129130
{
130131
network.chainType !== "solana" && network.chainType !== "aptos" && (
131-
<a class="button secondary" href="/ccip/tutorials/evm/token-manager#verifying-your-token">
132-
<img
133-
src="/assets/icons/plus.svg"
134-
alt="Add"
135-
style={{ width: "1em", height: "1em", marginRight: "0.5em", verticalAlign: "middle" }}
136-
/>
137-
Add my token
138-
</a>
132+
<AddButton href="/ccip/tutorials/evm/token-manager#verifying-your-token" text="Add my token" />
139133
)
140134
}
141135
</div>

src/components/CCIP/Landing/ccip-landing.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import LazyVerifierGrid from "../VerifierGrid/LazyVerifierGrid"
1818
import StructuredData from "~/components/StructuredData.astro"
1919
import { generateDirectoryStructuredData } from "~/utils/ccipStructuredData"
2020
import { DOCS_BASE_URL } from "~/utils/structuredData"
21+
import AddButton from "~/components/CCIP/AddButton/AddButton.astro"
2122
2223
export type Props = {
2324
environment: Environment
@@ -82,7 +83,7 @@ const directoryStructuredData = generateDirectoryStructuredData(environment, net
8283
<div>
8384
<div class="ccip-heading">
8485
<h2>Tokens <span>({allTokens.length})</span></h2>
85-
<a class="button secondary" href="/ccip/tutorials/evm/token-manager#verifying-your-token">Add my token</a>
86+
<AddButton href="/ccip/tutorials/evm/token-manager#verifying-your-token" text="Add my token" />
8687
</div>
8788
<LazyTokenGrid tokens={allTokens} environment={environment} client:visible />
8889
</div>
@@ -139,7 +140,7 @@ const directoryStructuredData = generateDirectoryStructuredData(environment, net
139140
--doc-padding: var(--space-10x);
140141
padding-top: var(--doc-padding);
141142
padding-bottom: var(--doc-padding);
142-
gap: var(--space-24x);
143+
gap: var(--space-10x);
143144
}
144145
}
145146
</style>

src/styles/theme.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
--color-gray-90: var(--color-base-gray), 90%;
4545
--color-gray-95: var(--color-base-gray), 95%;
4646

47+
/* Tertiary color aliases (matches design system) */
48+
--tertiary-border: #d1d6de;
49+
--tertiary-foreground: #0e1119;
50+
4751
--color-blue: var(--color-base-blue), 61%;
4852
--color-blue-dark: var(--color-base-blue-dark), 39%;
4953
--color-green: var(--color-base-green), 42%;

0 commit comments

Comments
 (0)