diff --git a/docs/next-env.d.ts b/docs/next-env.d.ts index fd36f9494..4f11a03dc 100644 --- a/docs/next-env.d.ts +++ b/docs/next-env.d.ts @@ -1,6 +1,5 @@ /// /// -/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/docs/src/components/button.tsx b/docs/src/components/button.tsx index 8d82b27a9..de717ea6a 100644 --- a/docs/src/components/button.tsx +++ b/docs/src/components/button.tsx @@ -12,10 +12,11 @@ type ButtonProps = { const baseClasses = 'block rounded-lg px-5 py-3 text-center font-semibold leading-none border transition-colors'; + const impactClasses: Record = { - bold: 'rounded-lg bg-black px-5 py-3 text-center font-semibold leading-none text-white hover:bg-neutral-800 border-transparent', + bold: 'bg-black text-white hover:bg-neutral-800 border-transparent', light: - 'rounded-lg bg-transparent border-black text-black px-5 py-3 text-center font-semibold leading-none hover:bg-neutral-800/10 active:bg-neutral-800/20', + 'bg-transparent border-black text-black hover:bg-neutral-800/10 active:bg-neutral-800/20', }; // ---------- @@ -32,14 +33,14 @@ export default function Button({ {children} ) : ( diff --git a/docs/src/components/copy-command-button.tsx b/docs/src/components/copy-command-button.tsx new file mode 100644 index 000000000..ff6837a4d --- /dev/null +++ b/docs/src/components/copy-command-button.tsx @@ -0,0 +1,66 @@ +'use client'; + +import { useState } from 'react'; +import { copyTextToClipboard } from '../utils'; +import Button from './button'; + +export function CopyCommandButton() { + const copyCommandText = 'npm create @keystatic@latest'; + const [isCopied, setIsCopied] = useState(false); + + const handleCopyCommand = async () => { + try { + await copyTextToClipboard(copyCommandText); + setIsCopied(true); + setTimeout(() => { + setIsCopied(false); + }, 1500); + } catch (err) { + console.log(err); + } + }; + + return ( + + ); +} diff --git a/docs/src/components/hero.tsx b/docs/src/components/hero.tsx index d895fd501..6366a5c01 100644 --- a/docs/src/components/hero.tsx +++ b/docs/src/components/hero.tsx @@ -1,11 +1,12 @@ import Link from 'next/link'; import Button from './button'; +import { CopyCommandButton } from './copy-command-button'; export default function Hero() { return (
-
-
+
+

Content Management
@@ -27,14 +28,20 @@ export default function Hero() {

-

+

A new tool that makes Markdown, JSON and YAML content in your - codebase editable by humans. + codebase editable by humans. Live edit content on GitHub or your + local file system, without disrupting your existing code and + workflows.

- +
+ + + +
-

- Live edit content on GitHub or your local file system, without - disrupting your existing code and workflows. -

-
`${src}?width=${width} ${width}w`).join(', '); } + +export async function copyTextToClipboard(text: string) { + if ('clipboard' in navigator) { + return await navigator.clipboard.writeText(text); + } +}