Revert "Display the correct button based on the user platform (#46)"

This reverts commit 732668a5c2.
This commit is contained in:
Bartosz Jarocki 2024-01-16 21:48:59 +01:00
parent 732668a5c2
commit 787afb5a18
2 changed files with 1 additions and 20 deletions

View File

@ -13,7 +13,6 @@ import {
} from "@/components/ui/command";
import { Button } from "./ui/button";
import { CommandIcon } from "lucide-react";
import { useOS } from "@/hooks/useOS";
interface Props {
links: { url: string; title: string }[];
@ -21,7 +20,6 @@ interface Props {
export const CommandMenu = ({ links }: Props) => {
const [open, setOpen] = React.useState(false);
const os = useOS();
React.useEffect(() => {
const down = (e: KeyboardEvent) => {
@ -40,7 +38,7 @@ export const CommandMenu = ({ links }: Props) => {
<p className="fixed bottom-0 left-0 right-0 hidden border-t border-t-muted bg-white p-1 text-center text-sm text-muted-foreground print:hidden xl:block">
Press{" "}
<kbd className="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">
<span className="text-xs">{os === "mac" ? "⌘" : "CTRL"}</span>+ J
<span className="text-xs"></span>J
</kbd>{" "}
to open the command menu
</p>

View File

@ -1,17 +0,0 @@
import { useMemo } from "react";
export type OS = "mac" | "windows" | "linux" | "other";
export const useOS = (): OS => {
const getOperatingSystem = (): OS => {
const userAgent = window.navigator.userAgent.toLowerCase();
if (userAgent.includes("mac")) return "mac";
if (userAgent.includes("win")) return "windows";
if (userAgent.includes("linux")) return "linux";
return "other";
};
return useMemo(() => getOperatingSystem(), []);
};