Skip to content

Commit c7788c5

Browse files
committed
feat(buttons): added title for buttons
1 parent 26d906c commit c7788c5

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/components/editor/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo } from "react";
1+
import { useCallback, useMemo } from "react";
22

33
import { useStore } from "@/store/useStore";
44
import MonacoEditor, { OnMount } from "@monaco-editor/react";

src/components/nav-buttons.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Settings from "./settings";
77
import {
88
ReplaceIcon,
99
PlayIcon,
10-
TrashIcon,
10+
Trash2Icon,
1111
LoaderCircleIcon
1212
} from "lucide-react";
1313

@@ -44,23 +44,28 @@ const ButtonsNav = () => {
4444
disabled={isCodeExecuting}
4545
icon={
4646
isCodeExecuting ? (
47-
<LoaderCircleIcon className="animate-spin" />
47+
<LoaderCircleIcon className="h-5 w-5 animate-spin" />
4848
) : (
49-
<PlayIcon />
49+
<PlayIcon className="h-5 w-5" />
5050
)
5151
}
5252
label="Run"
53+
title="Execute Python Code"
5354
/>
5455
<NavButton
5556
onClick={handleTerminalClear}
5657
disabled={isCodeExecuting}
57-
icon={<TrashIcon />}
58+
icon={<Trash2Icon className="h-5 w-5" />}
5859
label="Clear Terminal"
60+
title="Clear Terminal"
5961
/>
6062
<NavButton
6163
onClick={handleDirectionChange}
62-
icon={<ReplaceIcon />}
63-
label="Toggle Direction"
64+
icon={<ReplaceIcon className="h-5 w-5" />}
65+
label={
66+
direction.substring(0, 1).toUpperCase() + direction.substring(1)
67+
}
68+
title="Change direction"
6469
/>
6570
</div>
6671
<div className="flex items-center">
@@ -76,18 +81,21 @@ const NavButton = memo(
7681
onClick,
7782
disabled,
7883
icon,
79-
label
84+
label,
85+
title
8086
}: {
8187
onClick: () => void;
8288
disabled?: boolean;
8389
icon: React.ReactNode;
8490
label: string;
91+
title: string;
8592
}) => (
8693
<Button
8794
onClick={onClick}
8895
disabled={disabled}
8996
variant="secondary"
9097
className="text-foreground"
98+
title={title}
9199
>
92100
{icon}
93101
<span className="ml-2 hidden sm:inline">{label}</span>

src/components/settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Settings() {
6565
<Drawer>
6666
<DrawerTrigger asChild>
6767
<Button
68-
title="Toggle settings drawer"
68+
title="Open Settings"
6969
variant="secondary"
7070
className="flex items-center space-x-2"
7171
>

0 commit comments

Comments
 (0)