Skip to content

Commit 76e63cb

Browse files
authored
github/deploy buttons (#13)
* fix checkmarks for runs * deploy/github buttons * fixes
1 parent 23f21f1 commit 76e63cb

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

components/deploy-button.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"use client";
2+
3+
import { Button } from "@/components/ui/button";
4+
import { VERCEL_DEPLOY_URL } from "@/lib/constants";
5+
6+
export function DeployButton() {
7+
return (
8+
<Button
9+
asChild
10+
className="h-8 gap-1.5 px-2 sm:px-3"
11+
size="sm"
12+
variant="default"
13+
>
14+
<a href={VERCEL_DEPLOY_URL} rel="noopener noreferrer" target="_blank">
15+
<svg
16+
aria-label="Vercel logomark"
17+
className="size-3.5"
18+
fill="currentColor"
19+
viewBox="0 0 76 76"
20+
>
21+
<title>Vercel logomark</title>
22+
<path d="m38 0 38 66H0z" />
23+
</svg>
24+
<span className="text-sm">Deploy Your Own</span>
25+
</a>
26+
</Button>
27+
);
28+
}

components/github-stars-button.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ type GitHubStarsButtonProps = {
1212
};
1313

1414
export function GitHubStarsButton({ initialStars }: GitHubStarsButtonProps) {
15-
if (!initialStars) {
16-
return null;
17-
}
18-
1915
return (
2016
<Button
2117
asChild
@@ -29,8 +25,12 @@ export function GitHubStarsButton({ initialStars }: GitHubStarsButtonProps) {
2925
rel="noopener noreferrer"
3026
target="_blank"
3127
>
32-
<GitHubIcon className="size-3.5" />
33-
<span className="text-sm">{formatAbbreviatedNumber(initialStars)}</span>
28+
<GitHubIcon className="size-4.5" />
29+
{initialStars && (
30+
<span className="text-sm">
31+
{formatAbbreviatedNumber(initialStars)}
32+
</span>
33+
)}
3434
</a>
3535
</Button>
3636
);

components/workflow/workflow-runs.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,13 @@ export function WorkflowRuns({
458458
const getStatusIcon = (status: string) => {
459459
switch (status) {
460460
case "success":
461-
return <Check className="h-3 w-3 text-primary" />;
461+
return <Check className="h-3 w-3 text-white" />;
462462
case "error":
463-
return <X className="h-3 w-3 text-primary" />;
463+
return <X className="h-3 w-3 text-white" />;
464464
case "running":
465-
return <Loader2 className="h-3 w-3 animate-spin text-primary" />;
465+
return <Loader2 className="h-3 w-3 animate-spin text-white" />;
466466
default:
467-
return <Clock className="h-3 w-3 text-primary" />;
467+
return <Clock className="h-3 w-3 text-white" />;
468468
}
469469
};
470470

components/workflow/workflow-toolbar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
type WorkflowNode,
8080
} from "@/lib/workflow-store";
8181
import { Panel } from "../ai-elements/panel";
82+
import { DeployButton } from "../deploy-button";
8283
import { GitHubStarsButton } from "../github-stars-button";
8384
import { WorkflowIcon } from "../ui/workflow-icon";
8485
import { UserMenu } from "../workflows/user-menu";
@@ -1181,6 +1182,7 @@ export const WorkflowToolbar = ({ workflowId }: WorkflowToolbarProps) => {
11811182
workflowId={workflowId}
11821183
/>
11831184
<GitHubStarsButton />
1185+
<DeployButton />
11841186
<UserMenu />
11851187
</Panel>
11861188

0 commit comments

Comments
 (0)