1import React from 'react';
2import cn from 'classnames';
3import { LinkButton } from 'indigo-react';
5import { ForwardButton } from 'components/Buttons';
7import useCopiable from 'lib/useCopiable';
9const renderDefaultCopyText = didCopy => (didCopy ? 'Copied!' : 'Copy');
11export default function CopyButton({
14 children = renderDefaultCopyText,
18 const [doCopy, didCopy] = useCopiable(text);
23 className={cn(className, {
33export function CopyButtonWide({
34 as: As = ForwardButton,
37 accessory = renderDefaultCopyText,
40 const [doCopy, didCopy] = useCopiable(text);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list