Skip to content

Commit cead2a6

Browse files
feat: add chain switch (#30)
Co-authored-by: Robin Le Caignec <[email protected]>
1 parent 8eb844e commit cead2a6

27 files changed

+2935
-3875
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
- name: Setup Node
1818
uses: actions/setup-node@v4
19+
with:
20+
node-version: '22'
1921

2022
- name: Install dependencies
2123
run: |

.vitepress/config.mts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { transformerTwoslash } from '@shikijs/vitepress-twoslash';
22
import tailwindcss from '@tailwindcss/vite';
33
import { defineConfig } from 'vitepress';
4+
import { fileURLToPath, URL } from 'node:url';
45
import { getSidebar } from './sidebar';
56
import {
67
groupIconMdPlugin,
@@ -17,6 +18,11 @@ export default defineConfig({
1718
ignoreDeadLinks: true,
1819
vite: {
1920
plugins: [tailwindcss(), groupIconVitePlugin()],
21+
resolve: {
22+
alias: {
23+
'@': fileURLToPath(new URL('../src', import.meta.url)),
24+
},
25+
},
2026
},
2127
srcDir: './src',
2228
markdown: {
@@ -89,6 +95,12 @@ export default defineConfig({
8995
{ text: 'Build iApp', link: '/build-iapp/what-is-iapp' },
9096
{ text: 'Use iApp', link: '/use-iapp/introduction' },
9197
{ text: 'Protocol', link: '/protocol/sdk' },
98+
{
99+
component: 'ChainSelector',
100+
props: {
101+
className: 'w-48',
102+
},
103+
},
92104
],
93105
outline: {
94106
level: [2, 4],

.vitepress/theme/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import 'virtual:group-icons.css';
99
import '@shikijs/vitepress-twoslash/style.css';
1010
import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query';
1111
import { WagmiPlugin } from '@wagmi/vue';
12-
import { wagmiAdapter } from '../../src/utils/wagmiConfig';
12+
import { createPinia } from 'pinia';
13+
import { wagmiAdapter } from '@/utils/wagmiConfig';
14+
import ChainSelector from '@/components/ChainSelector.vue';
1315
import './style.css';
1416

1517
export default {
@@ -19,11 +21,15 @@ export default {
1921
app.use(TwoslashFloatingVue as any);
2022

2123
const queryClient = new QueryClient();
24+
const pinia = createPinia();
2225

26+
app.use(pinia);
2327
app.use(VueQueryPlugin, { queryClient });
2428

2529
app.use(WagmiPlugin, { config: wagmiAdapter.wagmiConfig });
2630

31+
app.component('ChainSelector', ChainSelector);
32+
2733
googleAnalytics({
2834
id: 'GTM-P7KSD4T',
2935
});

.vitepress/theme/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
--color-danger-2: var(--vp-c-red-2);
7777
--color-danger-3: var(--vp-c-red-3);
7878
--color-danger-soft: var(--vp-c-red-soft);
79+
80+
/* ShadCN */
81+
--color-muted-foreground: var(--vp-c-text-3);
82+
--color-ring: var(--vp-c-brand-2);
83+
--color-destructive: var(--vp-c-red-2);
84+
--color-popover: var(--vp-c-bg);
85+
--color-popover-foreground: var(--vp-c-text-1);
86+
--color-accent: var(--vp-c-bg-soft);
87+
--color-accent-foreground: var(--vp-c-text-1);
7988
}
8089

8190
:root {

components.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://shadcn-vue.com/schema.json",
3+
"style": "new-york",
4+
"typescript": true,
5+
"tailwind": {
6+
"config": "",
7+
"css": "src/styles/globals.css",
8+
"baseColor": "neutral",
9+
"cssVariables": true,
10+
"prefix": ""
11+
},
12+
"aliases": {
13+
"components": "@/components",
14+
"composables": "@/composables",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib"
18+
},
19+
"iconLibrary": "iconify"
20+
}

0 commit comments

Comments
 (0)