diff --git a/crates/web/frontend/src/components/docs-button/docs-button.tsx b/crates/web/frontend/src/components/docs-button/docs-button.tsx new file mode 100644 index 0000000..ae942bb --- /dev/null +++ b/crates/web/frontend/src/components/docs-button/docs-button.tsx @@ -0,0 +1,34 @@ +import { cn } from "@/lib/utils"; +import { BookOpen } from "lucide-react"; +import { type MouseEvent, useCallback } from "react"; +import ActionButton from "../action-button/action-button"; + +interface Props { + className?: string; +} + +export const DocsButton = ({ className }: Props) => { + const handleClick = useCallback((e: MouseEvent) => { + window.open("/docs", "_blank"); + e.preventDefault(); + }, []); + + return ( + + + + Docs + + + ); +}; diff --git a/crates/web/frontend/src/components/footer/footer.tsx b/crates/web/frontend/src/components/footer/footer.tsx index 85a8e0c..acfd725 100644 --- a/crates/web/frontend/src/components/footer/footer.tsx +++ b/crates/web/frontend/src/components/footer/footer.tsx @@ -1,4 +1,5 @@ import { cn } from "@/lib/utils"; +import { DocsButton } from "../docs-button/docs-button"; import { LinkEditor } from "../link-editor/link-editor"; import ShortcutPopup from "../shortcut-popup/shortcut-popup"; import StarCount from "../star-count/star-count"; @@ -22,6 +23,7 @@ const Footer = ({ linkEditors, handleToggleLinked, className }: FooterProps) => />
+
diff --git a/crates/web/frontend/src/components/left-sidebar/left-sidebar.tsx b/crates/web/frontend/src/components/left-sidebar/left-sidebar.tsx index 4c1ade4..bc24948 100644 --- a/crates/web/frontend/src/components/left-sidebar/left-sidebar.tsx +++ b/crates/web/frontend/src/components/left-sidebar/left-sidebar.tsx @@ -2,7 +2,7 @@ import { useOnboarding } from "@/hooks/use-onboarding"; import { cn, isMac } from "@/lib/utils"; import type { Data } from "@/model/data"; import type FileType from "@/model/file-type"; -import { Book, History, Settings, Share } from "lucide-react"; +import { BookMarked, History, Settings, Share } from "lucide-react"; import { type MutableRefObject, useCallback, useEffect, useState } from "react"; import ActionButton from "../action-button/action-button"; import ExamplesTab from "../examples-tab/examples-tab"; @@ -115,7 +115,7 @@ export const LeftSidebar = ({ variant="subtle" onClick={() => handleClick("examples")} > - { const [stars, setStars] = useState(); - const [clicked, setClicked] = useState(false); const [fetching, setFetching] = useState(true); - const handleClick = useCallback((e: MouseEvent) => { - setClicked(true); - setTimeout(() => { - window.open("https://github.com/jorgehermo9/gq", "_blank"); - setClicked(false); - }, 0); - e.preventDefault(); - }, []); - useEffect(() => { fetch("https://api.github.com/repos/jorgehermo9/gq") .then((res) => res.json()) @@ -31,20 +21,20 @@ const StarCount = ({ className }: Props) => { }, []); return ( - - - + + + {fetching ? ( ) : ( -
- {stars} - +
+ {stars} +
)}
diff --git a/crates/web/frontend/src/components/web-assembly-badge/web-assembly-badge.tsx b/crates/web/frontend/src/components/web-assembly-badge/web-assembly-badge.tsx index 759c33d..0e9f232 100644 --- a/crates/web/frontend/src/components/web-assembly-badge/web-assembly-badge.tsx +++ b/crates/web/frontend/src/components/web-assembly-badge/web-assembly-badge.tsx @@ -4,9 +4,9 @@ import Image from "next/image"; export const WebAssemblyBadge = ({ className }: React.HTMLProps) => { return (
- Powered by + Powered by