Skip to content

Commit 480067b

Browse files
authored
[UI] Add user feedback when copying log to clipboard (#2978)
Use done icon for copying log - Brings better visual user feedback
1 parent b2d9e1c commit 480067b

File tree

1 file changed

+7
-1
lines changed
  • src/frontend/screens/Settings/sections/LogSettings

1 file changed

+7
-1
lines changed

src/frontend/screens/Settings/sections/LogSettings/index.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'
33
import { faFolderOpen } from '@fortawesome/free-solid-svg-icons'
44
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
55
import ContentCopyIcon from '@mui/icons-material/ContentCopy'
6+
import { Done } from '@mui/icons-material'
67
import { UpdateComponent } from 'frontend/components/UI'
78
import SettingsContext from '../../SettingsContext'
89
import './index.css'
@@ -64,6 +65,7 @@ export default function LogSettings() {
6465
const [logFileExist, setLogFileExist] = useState<boolean>(false)
6566
const [defaultLast, setDefaultLast] = useState<boolean>(false)
6667
const [refreshing, setRefreshing] = useState<boolean>(true)
68+
const [copiedLog, setCopiedLog] = useState<boolean>(false)
6769
const { appName, isDefault } = useContext(SettingsContext)
6870

6971
const getLogContent = () => {
@@ -163,6 +165,10 @@ export default function LogSettings() {
163165
<a
164166
onClick={() => {
165167
navigator.clipboard.writeText(logFileContent)
168+
setCopiedLog(true)
169+
setTimeout(() => {
170+
setCopiedLog(false)
171+
}, 3000)
166172
}}
167173
title={t(
168174
'setting.log.copy-to-clipboard',
@@ -172,7 +178,7 @@ export default function LogSettings() {
172178
>
173179
<div className="button-icontext-flex">
174180
<div className="button-icon-flex">
175-
<ContentCopyIcon />
181+
{copiedLog ? <Done /> : <ContentCopyIcon />}
176182
</div>
177183
<span className="button-icon-text">
178184
{t(

0 commit comments

Comments
 (0)