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..6eebf6e --- /dev/null +++ b/crates/web/frontend/src/components/docs-button/docs-button.tsx @@ -0,0 +1,28 @@ +import { Book, BookOpen } from "lucide-react"; +import ActionButton from "../action-button/action-button"; +import { type MouseEvent, useCallback } from "react"; + +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..6bc1d1e 100644 --- a/crates/web/frontend/src/components/footer/footer.tsx +++ b/crates/web/frontend/src/components/footer/footer.tsx @@ -3,6 +3,7 @@ import { LinkEditor } from "../link-editor/link-editor"; import ShortcutPopup from "../shortcut-popup/shortcut-popup"; import StarCount from "../star-count/star-count"; import { WebAssemblyBadge } from "../web-assembly-badge/web-assembly-badge"; +import { DocsButton } from "../docs-button/docs-button"; interface FooterProps { linkEditors: boolean; @@ -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..369f0fd 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 { Album, Book, 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); + window.open("https://github.com/jorgehermo9/gq", "_blank"); e.preventDefault(); }, []); @@ -38,13 +33,13 @@ const StarCount = ({ className }: Props) => { onClick={handleClick} > - + {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