Skip to content

Commit d79844b

Browse files
committed
Move API docs button to file dropdown option
1 parent a5073cd commit d79844b

3 files changed

Lines changed: 14 additions & 23 deletions

File tree

app/components/FileDropdown.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
<template v-for="(option, index) in options" :key="option.name ?? index">
1313
<DropdownMenuSeparator v-if="option.separator" />
1414

15+
<DropdownMenuItem v-else-if="option.href" as-child>
16+
<a :href="option.href" target="_blank">
17+
{{ option.title }}
18+
</a>
19+
</DropdownMenuItem>
20+
1521
<DropdownMenuItem v-else @select="option.click()">
1622
{{ option.title }}
1723
</DropdownMenuItem>

app/components/Preview.vue

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,6 @@
3333
<span class="hidden sm:inline">Export Image</span>
3434
</Dropdown>
3535

36-
<Button
37-
v-if="!$config.public.isDesktop && $config.public.isDistributing"
38-
as="a"
39-
href="/buy"
40-
target="_blank"
41-
variant="ghost"
42-
class="rounded-xl border border-zinc-200 bg-white/80 shadow-lg backdrop-blur-xl dark:border-zinc-800 dark:bg-zinc-900/80"
43-
>
44-
<ShoppingBagIcon class="h-4 w-4" />
45-
<span class="hidden sm:inline">Desktop App</span>
46-
</Button>
47-
48-
<Button
49-
as="a"
50-
href="https://api.showcode.app/docs"
51-
target="_blank"
52-
variant="ghost"
53-
class="rounded-xl border border-zinc-200 bg-white/80 shadow-lg backdrop-blur-xl dark:border-zinc-800 dark:bg-zinc-900/80"
54-
>
55-
<CodeIcon class="h-4 w-4" />
56-
<span class="hidden sm:inline">API</span>
57-
</Button>
5836
</div>
5937
</div>
6038

@@ -201,7 +179,6 @@ import { debounce } from 'lodash';
201179
import { detect } from 'detect-browser';
202180
import * as htmlToImage from 'html-to-image';
203181
import {
204-
CodeIcon,
205182
ShareIcon,
206183
ZoomInIcon,
207184
ZoomOutIcon,

app/pages/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,14 @@ const fileOptions = computed(() => {
220220
{
221221
separator: true,
222222
},
223+
{
224+
name: 'api-docs',
225+
title: 'View API Docs',
226+
href: 'https://api.showcode.app/docs',
227+
},
228+
{
229+
separator: true,
230+
},
223231
{
224232
name: 'help',
225233
title: 'Help Guide',

0 commit comments

Comments
 (0)