@@ -1,6 +1,6 @@
1import Link from "next/link";
1import Link from "next/link";
2import { useRouter } from "next/router";
2import { useRouter } from "next/router";
3−import { useState } from "react";
3+import { useState, useEffect } from "react";
4import classnames from "classnames";
4import classnames from "classnames";
5import path from "path";
5import path from "path";
6import MenuTray from "../components/MenuTray";
6import MenuTray from "../components/MenuTray";
@@ -24,6 +24,7 @@ function ActiveLink({ children, href, className, currentPath }) {
25export default function Header(props) {
25export default function Header(props) {
26 const [isOpen, setTray] = useState(false);
26 const [isOpen, setTray] = useState(false);
27+ const [shortcut, setShortcut] = useState("");
28 const currentPath = useRouter().asPath;
29 const currentPath = useRouter().asPath;
@@ -31,6 +32,21 @@ export default function Header(props) {
32 const firstCrumb = currentPath.split("/")[1];
33 const firstCrumb = currentPath.split("/")[1];
35+ const detectOS = () => {
36+ const agent = window.navigator.appVersion;
37+ if (agent.includes("Win")) {
39+ } else if (agent.includes("Mac")) {
41+ } else if (agent.includes("Linux")) {
47+ setShortcut(detectOS());
35 <header className="w-full px-4 md:px-8 md:w-10/12 flex flex-row justify-between items-center pt-8 md:pt-10 lg:pt-12 pb-10 md:pb-12 lg:pb-24">
51 <header className="w-full px-4 md:px-8 md:w-10/12 flex flex-row justify-between items-center pt-8 md:pt-10 lg:pt-12 pb-10 md:pb-12 lg:pb-24">
@@ -84,7 +100,7 @@ export default function Header(props) {
85 className="button-sm bg-wall text-gray"
101 className="button-sm bg-wall text-gray"
87− Search<div className="ml-4 text-lightGray">⌘K</div>
103+ Search<div className="ml-4 text-lightGray">{shortcut}</div>
88 </button>
104 </button>