Skip to content

Commit

Permalink
add a tooltip to api token (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr authored Jul 8, 2023
1 parent 566980a commit f6c5490
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/api-tokens/ApiTokenList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import FormGroup from "react-bootstrap/FormGroup";
import InputGroup from "react-bootstrap/InputGroup";
import Modal from "react-bootstrap/Modal";
import Placeholder from "react-bootstrap/Placeholder";
import OverlayTrigger from "react-bootstrap/OverlayTrigger";
import Tooltip from "react-bootstrap/Tooltip";

export default function ApiTokens() {
const navigation = useNavigation();
Expand Down Expand Up @@ -226,14 +228,16 @@ function Token({ token }: { token: string | null }) {
}, [setCopied, token]);

return (
<>
<OverlayTrigger
overlay={<Tooltip>{copied ? "Copied!" : "Click to copy"}</Tooltip>}
>
<span onClick={copy} style={{ cursor: "pointer" }}>
<code className="user-select-all">{token}</code>{" "}
<Button size="sm" variant="outline-secondary" className="ml-auto">
{copied ? <ClipboardCheckFill /> : <Clipboard />}
</Button>
</span>
</>
</OverlayTrigger>
);
}

Expand Down

0 comments on commit f6c5490

Please sign in to comment.