Skip to content

Commit 135f15c

Browse files
committed
fix(web): minor fixes
1 parent af39115 commit 135f15c

3 files changed

Lines changed: 34 additions & 214 deletions

File tree

apps/web/src/components/layouts/docs-layout.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import {
2-
ArrowLeft,
3-
ArrowRight,
4-
BookOpen,
5-
Code,
6-
Sparkles,
7-
Workflow,
8-
} from "lucide-react";
1+
import { BookOpen, Code, Sparkles, Workflow } from "lucide-react";
92
import React, { useEffect } from "react";
103
import { Link, useLocation } from "react-router";
114

125
import { Badge } from "@/components/ui/badge";
13-
import { Button } from "@/components/ui/button";
146
import { ScrollArea } from "@/components/ui/scroll-area";
157
import { cn } from "@/utils/utils";
168

@@ -27,23 +19,6 @@ export interface DocsSection {
2719
}[];
2820
}
2921

30-
export interface DocsNavigation {
31-
previous?: {
32-
title: string;
33-
href: string;
34-
};
35-
next?: {
36-
title: string;
37-
href: string;
38-
};
39-
}
40-
41-
export interface TableOfContentsItem {
42-
id: string;
43-
title: string;
44-
level: number;
45-
}
46-
4722
interface DocsLayoutProps {
4823
children: React.ReactNode;
4924
}

apps/web/src/pages/docs/api-page.tsx

Lines changed: 32 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ArrowRight, Copy } from "lucide-react";
1+
import { ArrowRight } from "lucide-react";
22
import { Link } from "react-router";
33

44
import {
@@ -18,10 +18,6 @@ export function DocsApiPage() {
1818
{ label: "API" },
1919
]);
2020

21-
const handleCopy = (text: string) => {
22-
navigator.clipboard.writeText(text);
23-
};
24-
2521
const BASE_URL = "https://api.dafthunk.com";
2622

2723
// Example URLs for documentation
@@ -134,84 +130,23 @@ export function DocsApiPage() {
134130
<TabsTrigger value="python">Python</TabsTrigger>
135131
</TabsList>
136132
<TabsContent value="curl" className="mt-4">
137-
<div className="relative">
138-
<CodeBlock language="bash">
139-
{EXECUTE_WORKFLOW_SNIPPETS.curl(exampleExecuteUrl, true, [])}
140-
</CodeBlock>
141-
<Button
142-
size="sm"
143-
variant="ghost"
144-
className="absolute top-2 right-2 h-7 w-7 p-0"
145-
onClick={() =>
146-
handleCopy(
147-
EXECUTE_WORKFLOW_SNIPPETS.curl(
148-
exampleExecuteUrl,
149-
true,
150-
[]
151-
)
152-
)
153-
}
154-
>
155-
<Copy className="h-4 w-4" />
156-
<span className="sr-only">Copy</span>
157-
</Button>
158-
</div>
133+
<CodeBlock language="bash">
134+
{EXECUTE_WORKFLOW_SNIPPETS.curl(exampleExecuteUrl, true, [])}
135+
</CodeBlock>
159136
</TabsContent>
160137
<TabsContent value="javascript" className="mt-4">
161-
<div className="relative">
162-
<CodeBlock language="javascript">
163-
{EXECUTE_WORKFLOW_SNIPPETS.javascript(
164-
exampleExecuteUrl,
165-
true,
166-
[]
167-
)}
168-
</CodeBlock>
169-
<Button
170-
size="sm"
171-
variant="ghost"
172-
className="absolute top-2 right-2 h-7 w-7 p-0"
173-
onClick={() =>
174-
handleCopy(
175-
EXECUTE_WORKFLOW_SNIPPETS.javascript(
176-
exampleExecuteUrl,
177-
true,
178-
[]
179-
)
180-
)
181-
}
182-
>
183-
<Copy className="h-4 w-4" />
184-
<span className="sr-only">Copy</span>
185-
</Button>
186-
</div>
138+
<CodeBlock language="javascript">
139+
{EXECUTE_WORKFLOW_SNIPPETS.javascript(
140+
exampleExecuteUrl,
141+
true,
142+
[]
143+
)}
144+
</CodeBlock>
187145
</TabsContent>
188146
<TabsContent value="python" className="mt-4">
189-
<div className="relative">
190-
<CodeBlock language="python">
191-
{EXECUTE_WORKFLOW_SNIPPETS.python(
192-
exampleExecuteUrl,
193-
true,
194-
[]
195-
)}
196-
</CodeBlock>
197-
<Button
198-
size="sm"
199-
variant="ghost"
200-
className="absolute top-2 right-2 h-7 w-7 p-0"
201-
onClick={() =>
202-
handleCopy(
203-
EXECUTE_WORKFLOW_SNIPPETS.python(
204-
exampleExecuteUrl,
205-
true,
206-
[]
207-
)
208-
)
209-
}
210-
>
211-
<Copy className="h-4 w-4" />
212-
<span className="sr-only">Copy</span>
213-
</Button>
214-
</div>
147+
<CodeBlock language="python">
148+
{EXECUTE_WORKFLOW_SNIPPETS.python(exampleExecuteUrl, true, [])}
149+
</CodeBlock>
215150
</TabsContent>
216151
</Tabs>
217152
</div>
@@ -264,68 +199,19 @@ export function DocsApiPage() {
264199
<TabsTrigger value="python">Python</TabsTrigger>
265200
</TabsList>
266201
<TabsContent value="curl" className="mt-4">
267-
<div className="relative">
268-
<CodeBlock language="bash">
269-
{GET_EXECUTION_STATUS_SNIPPETS.curl(exampleStatusBaseUrl)}
270-
</CodeBlock>
271-
<Button
272-
size="sm"
273-
variant="ghost"
274-
className="absolute top-2 right-2 h-7 w-7 p-0"
275-
onClick={() =>
276-
handleCopy(
277-
GET_EXECUTION_STATUS_SNIPPETS.curl(exampleStatusBaseUrl)
278-
)
279-
}
280-
>
281-
<Copy className="h-4 w-4" />
282-
<span className="sr-only">Copy</span>
283-
</Button>
284-
</div>
202+
<CodeBlock language="bash">
203+
{GET_EXECUTION_STATUS_SNIPPETS.curl(exampleStatusBaseUrl)}
204+
</CodeBlock>
285205
</TabsContent>
286206
<TabsContent value="javascript" className="mt-4">
287-
<div className="relative">
288-
<CodeBlock language="javascript">
289-
{GET_EXECUTION_STATUS_SNIPPETS.javascript(
290-
exampleStatusBaseUrl
291-
)}
292-
</CodeBlock>
293-
<Button
294-
size="sm"
295-
variant="ghost"
296-
className="absolute top-2 right-2 h-7 w-7 p-0"
297-
onClick={() =>
298-
handleCopy(
299-
GET_EXECUTION_STATUS_SNIPPETS.javascript(
300-
exampleStatusBaseUrl
301-
)
302-
)
303-
}
304-
>
305-
<Copy className="h-4 w-4" />
306-
<span className="sr-only">Copy</span>
307-
</Button>
308-
</div>
207+
<CodeBlock language="javascript">
208+
{GET_EXECUTION_STATUS_SNIPPETS.javascript(exampleStatusBaseUrl)}
209+
</CodeBlock>
309210
</TabsContent>
310211
<TabsContent value="python" className="mt-4">
311-
<div className="relative">
312-
<CodeBlock language="python">
313-
{GET_EXECUTION_STATUS_SNIPPETS.python(exampleStatusBaseUrl)}
314-
</CodeBlock>
315-
<Button
316-
size="sm"
317-
variant="ghost"
318-
className="absolute top-2 right-2 h-7 w-7 p-0"
319-
onClick={() =>
320-
handleCopy(
321-
GET_EXECUTION_STATUS_SNIPPETS.python(exampleStatusBaseUrl)
322-
)
323-
}
324-
>
325-
<Copy className="h-4 w-4" />
326-
<span className="sr-only">Copy</span>
327-
</Button>
328-
</div>
212+
<CodeBlock language="python">
213+
{GET_EXECUTION_STATUS_SNIPPETS.python(exampleStatusBaseUrl)}
214+
</CodeBlock>
329215
</TabsContent>
330216
</Tabs>
331217
</div>
@@ -441,60 +327,19 @@ export function DocsApiPage() {
441327
<TabsTrigger value="python">Python</TabsTrigger>
442328
</TabsList>
443329
<TabsContent value="curl" className="mt-4">
444-
<div className="relative">
445-
<CodeBlock language="bash">
446-
{GET_OBJECT_SNIPPETS.curl(exampleObjectBaseUrl)}
447-
</CodeBlock>
448-
<Button
449-
size="sm"
450-
variant="ghost"
451-
className="absolute top-2 right-2 h-7 w-7 p-0"
452-
onClick={() =>
453-
handleCopy(GET_OBJECT_SNIPPETS.curl(exampleObjectBaseUrl))
454-
}
455-
>
456-
<Copy className="h-4 w-4" />
457-
<span className="sr-only">Copy</span>
458-
</Button>
459-
</div>
330+
<CodeBlock language="bash">
331+
{GET_OBJECT_SNIPPETS.curl(exampleObjectBaseUrl)}
332+
</CodeBlock>
460333
</TabsContent>
461334
<TabsContent value="javascript" className="mt-4">
462-
<div className="relative">
463-
<CodeBlock language="javascript">
464-
{GET_OBJECT_SNIPPETS.javascript(exampleObjectBaseUrl)}
465-
</CodeBlock>
466-
<Button
467-
size="sm"
468-
variant="ghost"
469-
className="absolute top-2 right-2 h-7 w-7 p-0"
470-
onClick={() =>
471-
handleCopy(
472-
GET_OBJECT_SNIPPETS.javascript(exampleObjectBaseUrl)
473-
)
474-
}
475-
>
476-
<Copy className="h-4 w-4" />
477-
<span className="sr-only">Copy</span>
478-
</Button>
479-
</div>
335+
<CodeBlock language="javascript">
336+
{GET_OBJECT_SNIPPETS.javascript(exampleObjectBaseUrl)}
337+
</CodeBlock>
480338
</TabsContent>
481339
<TabsContent value="python" className="mt-4">
482-
<div className="relative">
483-
<CodeBlock language="python">
484-
{GET_OBJECT_SNIPPETS.python(exampleObjectBaseUrl)}
485-
</CodeBlock>
486-
<Button
487-
size="sm"
488-
variant="ghost"
489-
className="absolute top-2 right-2 h-7 w-7 p-0"
490-
onClick={() =>
491-
handleCopy(GET_OBJECT_SNIPPETS.python(exampleObjectBaseUrl))
492-
}
493-
>
494-
<Copy className="h-4 w-4" />
495-
<span className="sr-only">Copy</span>
496-
</Button>
497-
</div>
340+
<CodeBlock language="python">
341+
{GET_OBJECT_SNIPPETS.python(exampleObjectBaseUrl)}
342+
</CodeBlock>
498343
</TabsContent>
499344
</Tabs>
500345
</div>

apps/web/src/pages/public-execution-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function PublicExecutionPage() {
4343
if (preferredTheme) {
4444
setTheme(preferredTheme as "dark" | "light" | "system");
4545
}
46-
}, [preferredTheme]);
46+
}, [preferredTheme, setTheme]);
4747

4848
useEffect(() => {
4949
if (

0 commit comments

Comments
 (0)