From a03eed16030c00cce3b94625832eefccb36f0516 Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Tue, 14 May 2019 20:12:52 +0200 Subject: [PATCH] Copy button copies token to clipboard --- client/modules/User/components/APIKeyForm.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/modules/User/components/APIKeyForm.jsx b/client/modules/User/components/APIKeyForm.jsx index bffd0ffc..a0da81b6 100644 --- a/client/modules/User/components/APIKeyForm.jsx +++ b/client/modules/User/components/APIKeyForm.jsx @@ -7,12 +7,17 @@ import orderBy from 'lodash/orderBy'; const trashCan = require('../../../images/trash-can.svg'); + function NewTokenDisplay({ token }) { + function handleCopyClick() { + navigator.clipboard.writeText(token); + } + return (

Make sure to copy your new personal access token now. You won’t be able to see it again!

- +
); }