1import React from 'react';
2import cn from 'classnames';
3import { LinkButton } from 'indigo-react';
5import useCopiable from 'lib/useCopiable';
7const renderDefaultCopyText = didCopy => (didCopy ? 'Copied!' : 'Copy');
9export default function CopyButton({
12 children = renderDefaultCopyText,
16 const [doCopy, didCopy] = useCopiable(text);
21 className={cn(className, {
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