copy to clipboard button

pull/276/head
Mikael Finstad 2020-02-20 21:21:54 +08:00
rodzic 16edb60e95
commit bcbf2d5dff
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -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 }) => (
<AnimatePresence>
{visible && (
@ -49,8 +55,8 @@ const HelpSheet = ({ visible, onTogglePress, renderSettings, ffmpegCommandLog })
<h1>Last ffmpeg commands</h1>
<div style={{ overflowY: 'scroll', height: 200 }}>
{ffmpegCommandLog.reverse().map((log) => (
<div key={log} style={{ whiteSpace: 'pre' }}>
{log}
<div key={log} style={{ whiteSpace: 'pre', margin: '5px 0' }}>
<FaClipboard style={{ cursor: 'pointer' }} title="Copy to clipboard" onClick={() => { clipboard.writeText(log); toast.fire({ timer: 2000, icon: 'success', title: 'Copied to clipboard' }); }} /> {log}
</div>
))}
</div>