Skip to content

Commit

Permalink
update command keys (#2271)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx authored Aug 30, 2024
1 parent 1734a4a commit 8f26728
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
12 changes: 6 additions & 6 deletions web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const ToggleSwitch = () => {
onClick={() => handleTabChange("search")}
>
<SearchIcon size={16} className="mr-2" />
<p className="items-baseline flex">
<div className="flex items-end">
Search
<span className="text-xs ml-2">{commandSymbol}S</span>
</p>
<div className="ml-2 flex items-end">{commandSymbol}S</div>
</div>
</button>
<button
className={`px-4 py-2 rounded-full text-sm font-medium transition-colors duration-300 ease-in-out flex items-center relative z-10 ${
Expand All @@ -67,10 +67,10 @@ const ToggleSwitch = () => {
onClick={() => handleTabChange("chat")}
>
<ChatIcon size={16} className="mr-2" />
<p className="items-baseline flex">
<div className="items-end flex">
Chat
<span className="text-xs ml-2">{commandSymbol}D</span>
</p>
<div className="ml-2 flex items-end">{commandSymbol}D</div>
</div>
</button>
</div>
);
Expand Down
42 changes: 42 additions & 0 deletions web/src/components/icons/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2754,3 +2754,45 @@ export const CameraIcon = ({
</svg>
);
};

export const MacIcon = ({
size = 16,
className = "my-auto flex flex-shrink-0 ",
}: IconProps) => {
return (
<svg
style={{ width: `${size}px`, height: `${size}px` }}
className={`w-[${size}px] h-[${size}px] ` + className}
xmlns="http://www.w3.org/2000/svg"
width="200"
height="200"
viewBox="0 0 24 24"
>
<path
fill="currentColor"
d="M6.5 4.5a2 2 0 0 1 2 2v2h-2a2 2 0 1 1 0-4Zm4 4v-2a4 4 0 1 0-4 4h2v3h-2a4 4 0 1 0 4 4v-2h3v2a4 4 0 1 0 4-4h-2v-3h2a4 4 0 1 0-4-4v2h-3Zm0 2h3v3h-3v-3Zm5-2v-2a2 2 0 1 1 2 2h-2Zm0 7h2a2 2 0 1 1-2 2v-2Zm-7 0v2a2 2 0 1 1-2-2h2Z"
/>
</svg>
);
};

export const WindowsIcon = ({
size = 16,
className = "my-auto flex flex-shrink-0 ",
}: IconProps) => {
return (
<svg
style={{ width: `${size}px`, height: `${size}px` }}
className={`w-[${size}px] h-[${size}px] ` + className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="24"
height="24"
>
<path
fill="currentColor"
d="M3 3h8v8H3V3zm10 0h8v8h-8V3zm-10 10h8v8H3v-8zm10 0h8v8h-8v-8z"
/>
</svg>
);
};
5 changes: 3 additions & 2 deletions web/src/lib/browserUtilities.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { MacIcon, WindowsIcon } from "@/components/icons/icons";
import { useState, useEffect } from "react";

type OperatingSystem = "Windows" | "Mac" | "Other";
Expand All @@ -23,9 +24,9 @@ const KeyboardSymbol = () => {
const os = useOperatingSystem();

if (os === "Windows") {
return "⊞";
return <WindowsIcon size={12} />;
} else {
return "⌘";
return <MacIcon size={12} />;
}
};

Expand Down

0 comments on commit 8f26728

Please sign in to comment.