mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 15:17:09 +00:00
Add paste button on mobile + update copy icon (#610)
This commit is contained in:
@@ -202,8 +202,18 @@ export function SourcePanel({ name, model, blockStates, doCopy, doDownload, doIm
|
||||
setHighlighting(value)
|
||||
}
|
||||
|
||||
const importFromClipboard = useCallback(async () => {
|
||||
if (editor.current) {
|
||||
const text = await navigator.clipboard.readText()
|
||||
editor.current.setValue(text)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return <>
|
||||
<div class="controls source-controls">
|
||||
{window.matchMedia('(pointer: coarse)').matches && <>
|
||||
<Btn icon="paste" onClick={importFromClipboard} />
|
||||
</>}
|
||||
<BtnMenu icon="gear" tooltip={locale('output_settings')} data-cy="source-controls">
|
||||
{getSourceIndents().map(key =>
|
||||
<Btn label={locale(`indentation.${key}`)} active={indent === key}
|
||||
|
||||
Reference in New Issue
Block a user