mirror of
https://github.com/block/buzz.git
synced 2026-10-31 14:31:02 +00:00
fix(desktop): polish Projects navigation and detail presentation
Make sidebar and repository navigation behave predictably while clarifying review metadata, activity hierarchy, and file-detail presentation. Signed-off-by: Thomas Petersen <thomasp@squareup.com>
This commit is contained in:
@@ -15,12 +15,16 @@ export function CopyTextButton({
|
||||
text: string;
|
||||
}) {
|
||||
const [copied, setCopied] = React.useState(false);
|
||||
const handleCopy = React.useCallback(() => {
|
||||
void writeTextToClipboard(text).then(() => {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2_000);
|
||||
});
|
||||
}, [text]);
|
||||
const handleCopy = React.useCallback(
|
||||
(event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
event.stopPropagation();
|
||||
void writeTextToClipboard(text).then(() => {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2_000);
|
||||
});
|
||||
},
|
||||
[text],
|
||||
);
|
||||
|
||||
return (
|
||||
<button
|
||||
@@ -30,6 +34,7 @@ export function CopyTextButton({
|
||||
className,
|
||||
)}
|
||||
onClick={handleCopy}
|
||||
onKeyDown={(event) => event.stopPropagation()}
|
||||
type="button"
|
||||
>
|
||||
{copied ? (
|
||||
|
||||
Reference in New Issue
Block a user