Add missing label (#12160)

This commit is contained in:
Marcus Blättermann 2023-01-24 13:52:55 +01:00 committed by GitHub
parent fcedcd54a8
commit 3aa61e615f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export function copyToClipboard(ref, callback) {
}
}
export default function CopyInput({ text, prefix }) {
export default function CopyInput({ text, description, prefix }) {
const isClient = typeof window !== 'undefined'
const [supportsCopy, setSupportsCopy] = useState(false)
@ -41,6 +41,7 @@ export default function CopyInput({ text, prefix }) {
defaultValue={text}
rows={1}
onClick={selectText}
aria-label={description}
/>
{supportsCopy && (
<button title="Copy to clipboard" onClick={onClick}>

View File

@ -29,7 +29,11 @@ export default function Project({
return (
<Infobox title={header} emoji="🪐">
{children}
<CopyInput text={text} prefix="$" />
<CopyInput
text={text}
prefix="$"
description="Example bash command to start with an end-to-end template"
/>
</Infobox>
)
}