From bcbf2d5dff228ecf79cf4bc9ea6c326cf714ff51 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 20 Feb 2020 21:21:54 +0800 Subject: [PATCH] copy to clipboard button --- src/HelpSheet.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/HelpSheet.jsx b/src/HelpSheet.jsx index a2f01063..d6555d72 100644 --- a/src/HelpSheet.jsx +++ b/src/HelpSheet.jsx @@ -1,7 +1,13 @@ import React from 'react'; import { IoIosCloseCircleOutline } from 'react-icons/io'; +import { FaClipboard } from 'react-icons/fa'; import { motion, AnimatePresence } from 'framer-motion'; +const { toast } = require('./util'); + +// eslint-disable-next-line import/no-extraneous-dependencies +const { clipboard } = require('electron'); + const HelpSheet = ({ visible, onTogglePress, renderSettings, ffmpegCommandLog }) => ( {visible && ( @@ -49,8 +55,8 @@ const HelpSheet = ({ visible, onTogglePress, renderSettings, ffmpegCommandLog })

Last ffmpeg commands

{ffmpegCommandLog.reverse().map((log) => ( -
- {log} +
+ { clipboard.writeText(log); toast.fire({ timer: 2000, icon: 'success', title: 'Copied to clipboard' }); }} /> {log}
))}