Skip to content

Commit fea3318

Browse files
authored
docs: add github link on demo.tutorialkit.dev (#338)
1 parent 5c1de69 commit fea3318

File tree

5 files changed

+57
-7
lines changed

5 files changed

+57
-7
lines changed

docs/demo/astro.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ export default defineConfig({
55
devToolbar: {
66
enabled: false,
77
},
8-
integrations: [tutorialkit()],
8+
integrations: [
9+
tutorialkit({
10+
components: {
11+
TopBar: './src/components/TopBar.astro',
12+
},
13+
}),
14+
],
915
});

docs/demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@tutorialkit/astro": "workspace:*",
2222
"@tutorialkit/theme": "workspace:*",
2323
"@tutorialkit/types": "workspace:*",
24+
"@types/react": "^18.3.3",
2425
"astro": "^4.15.0",
2526
"prettier-plugin-astro": "^0.14.1",
2627
"typescript": "^5.4.5"

docs/demo/src/components/Github.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export function Github() {
2+
return (
3+
<a
4+
href="https://github.com/stackblitz/tutorialkit/tree/main/docs/demo"
5+
className="flex items-center text-2xl text-tk-elements-topBar-iconButton-iconColor hover:text-tk-elements-topBar-iconButton-iconColorHover bg-tk-elements-topBar-iconButton-backgroundColor hover:bg-tk-elements-topBar-iconButton-backgroundColorHover p-1 mr-2 transition-theme rounded-md"
6+
title="Github"
7+
>
8+
<svg
9+
xmlns="http://www.w3.org/2000/svg"
10+
viewBox="0 0 24 24"
11+
style={{ height: '1.3rem', width: '1.3rem', fill: 'var(--tk-elements-topBar-iconButton-iconColor)' }}
12+
>
13+
<g>
14+
<rect width="24" height="24" opacity="0"></rect>
15+
<path d="M16.24 22a1 1 0 0 1-1-1v-2.6a2.15 2.15 0 0 0-.54-1.66 1 1 0 0 1 .61-1.67C17.75 14.78 20 14 20 9.77a4 4 0 0 0-.67-2.22 2.75 2.75 0 0 1-.41-2.06 3.71 3.71 0 0 0 0-1.41 7.65 7.65 0 0 0-2.09 1.09 1 1 0 0 1-.84.15 10.15 10.15 0 0 0-5.52 0 1 1 0 0 1-.84-.15 7.4 7.4 0 0 0-2.11-1.09 3.52 3.52 0 0 0 0 1.41 2.84 2.84 0 0 1-.43 2.08 4.07 4.07 0 0 0-.67 2.23c0 3.89 1.88 4.93 4.7 5.29a1 1 0 0 1 .82.66 1 1 0 0 1-.21 1 2.06 2.06 0 0 0-.55 1.56V21a1 1 0 0 1-2 0v-.57a6 6 0 0 1-5.27-2.09 3.9 3.9 0 0 0-1.16-.88 1 1 0 1 1 .5-1.94 4.93 4.93 0 0 1 2 1.36c1 1 2 1.88 3.9 1.52a3.89 3.89 0 0 1 .23-1.58c-2.06-.52-5-2-5-7a6 6 0 0 1 1-3.33.85.85 0 0 0 .13-.62 5.69 5.69 0 0 1 .33-3.21 1 1 0 0 1 .63-.57c.34-.1 1.56-.3 3.87 1.2a12.16 12.16 0 0 1 5.69 0c2.31-1.5 3.53-1.31 3.86-1.2a1 1 0 0 1 .63.57 5.71 5.71 0 0 1 .33 3.22.75.75 0 0 0 .11.57 6 6 0 0 1 1 3.34c0 5.07-2.92 6.54-5 7a4.28 4.28 0 0 1 .22 1.67V21a1 1 0 0 1-.94 1z"></path>
16+
</g>
17+
</svg>
18+
</a>
19+
);
20+
}

docs/demo/src/components/TopBar.astro

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
import { Github } from './Github';
3+
---
4+
5+
<nav
6+
class="bg-tk-elements-topBar-backgroundColor transition-theme border-b border-tk-elements-app-borderColor flex max-w-full items-center p-3 px-4 min-h-[56px]"
7+
>
8+
<div class="flex flex-1">
9+
<slot name="logo" />
10+
</div>
11+
<div class="mr-2">
12+
<slot name="open-in-stackblitz-link" />
13+
</div>
14+
15+
<Github />
16+
17+
<div>
18+
<slot name="theme-switch" />
19+
</div>
20+
<div>
21+
<slot name="login-button" />
22+
</div>
23+
</nav>

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)