Skip to content

Open source CapCut alternative.

TypeScript

refactor(site): replace TaskArrow with DonkeyCursor in prototype

David Lef6872cf0d7f8
diff --git a/site/src/app/prototype/_components/DemoControls.tsx b/site/src/app/prototype/_components/DemoControls.tsx
index c6d725eb..969fde32 100644
--- a/site/src/app/prototype/_components/DemoControls.tsx
+++ b/site/src/app/prototype/_components/DemoControls.tsx
@@ -1,6 +1,6 @@
import { Check, Trash2 } from 'lucide-react';
-import { TaskArrow } from '@/app/prototype/_components/TaskArrow';
+import { DonkeyCursor } from '@/app/prototype/_components/DonkeyCursor';
import { ALL_TASK_IDS, TASKS } from '@/app/prototype/_components/tasks';
import type { NotchState, TaskId } from '@/app/prototype/_components/types';
@@ -80,7 +80,7 @@ export function DemoControls({
}}
aria-label={task.label}
>
- {active ? <Check size={14} color={task.color} /> : <TaskArrow color={task.color} size={15} />}
+ {active ? <Check size={14} color={task.color} /> : <DonkeyCursor color={task.color} size={15} />}
</button>
);
})}
diff --git a/site/src/app/prototype/_components/DonkeyCursor.tsx b/site/src/app/prototype/_components/DonkeyCursor.tsx
index 48a80672..1f8e8c5b 100644
--- a/site/src/app/prototype/_components/DonkeyCursor.tsx
+++ b/site/src/app/prototype/_components/DonkeyCursor.tsx
@@ -1,11 +1,12 @@
type Props = {
color: string;
size?: number;
+ className?: string;
};
-export function DonkeyCursor({ color, size = 28 }: Props) {
+export function DonkeyCursor({ color, size = 28, className }: Props) {
return (
- <div className="relative" style={{ width: size, height: size }}>
+ <div className={`relative flex-shrink-0 ${className ?? ''}`} style={{ width: size, height: size }}>
<svg
viewBox="0 0 100 100"
width={size}
diff --git a/site/src/app/prototype/_components/Notch.tsx b/site/src/app/prototype/_components/Notch.tsx
index 650f6f22..fc13d6e8 100644
--- a/site/src/app/prototype/_components/Notch.tsx
+++ b/site/src/app/prototype/_components/Notch.tsx
@@ -2,7 +2,7 @@ import { ArrowUp, Check, MessageCircle, Pause, Play } from 'lucide-react';
import type { FormEvent } from 'react';
import { ActivityBars } from '@/app/prototype/_components/ActivityBars';
-import { TaskArrow } from '@/app/prototype/_components/TaskArrow';
+import { DonkeyCursor } from '@/app/prototype/_components/DonkeyCursor';
import { TASKS } from '@/app/prototype/_components/tasks';
import type { NotchState, Spawn, TaskId } from '@/app/prototype/_components/types';
@@ -133,7 +133,7 @@ export function Notch({ state, activeTaskId, expanded, setExpanded, spawnCue, on
}}
aria-hidden="true"
>
- <TaskArrow color={spawnCue.color} size={15} />
+ <DonkeyCursor color={spawnCue.color} size={15} />
</div>
</>
);
@@ -178,7 +178,7 @@ export function Notch({ state, activeTaskId, expanded, setExpanded, spawnCue, on
pointerEvents: 'none',
}}
>
- <TaskArrow color={activeColor} size={13} className="absolute left-[10.5px] top-[9.5px] -rotate-45" />
+ <DonkeyCursor color={activeColor} size={13} className="absolute left-[10.5px] top-[9.5px]" />
{!isResting && (
<span className="absolute right-0 top-0 grid h-8 w-[34px] place-items-center text-[9px] leading-none text-white/[0.72]">
{collapsedStatusText(state)}
@@ -208,7 +208,7 @@ export function Notch({ state, activeTaskId, expanded, setExpanded, spawnCue, on
key={task.id}
className="flex h-12 items-center gap-3 rounded-lg bg-white/[0.055] px-3"
>
- <TaskArrow color={task.color} size={14} className="-rotate-45" />
+ <DonkeyCursor color={task.color} size={14} />
<div className="min-w-0 flex-1">
<h2 className="truncate text-[13px] font-normal leading-4 text-white/[0.9]">{task.title}</h2>
<p className="mt-1 truncate text-[12px] font-normal leading-[14px] text-white/[0.42]">
diff --git a/site/src/app/prototype/_components/TaskArrow.tsx b/site/src/app/prototype/_components/TaskArrow.tsx
deleted file mode 100644
index c45cd01d..00000000
--- a/site/src/app/prototype/_components/TaskArrow.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-type Props = {
- color: string;
- size?: number;
- className?: string;
-};
-
-export function TaskArrow({ color, size = 14, className }: Props) {
- return (
- <svg
- width={size}
- height={size}
- viewBox="0 0 14 14"
- aria-hidden="true"
- className={`flex-shrink-0 ${className ?? ''}`}
- >
- <path d="M2.52 0.84 12.32 7 2.52 13.16 4.76 7 2.52 0.84Z" fill={color} />
- </svg>
- );
-}