♿ move file sharing to context menu
This commit is contained in:
@@ -1165,16 +1165,6 @@ export function MarkdownEditor(): JSX.Element {
|
|||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
})()}
|
})()}
|
||||||
<button
|
|
||||||
className="statusbar-share-btn"
|
|
||||||
onClick={async () => {
|
|
||||||
const fileName = activeFilePath.split('/').pop()?.replace(/\.md$/, '') ?? 'document'
|
|
||||||
await window.api.exportPDF(activeFileContent, fileName)
|
|
||||||
}}
|
|
||||||
title="Export document as PDF"
|
|
||||||
>
|
|
||||||
⎙
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -190,7 +190,16 @@ export function FileTreeNode({ node, depth, dirPath, siblings }: Props): JSX.Ele
|
|||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
{ label: 'Rename', action: startRename },
|
{ label: 'Rename', action: startRename },
|
||||||
{ label: 'Delete', action: submitDelete, danger: true }
|
{ label: 'Delete', action: submitDelete, danger: true },
|
||||||
|
'separator',
|
||||||
|
{
|
||||||
|
label: 'Export as PDF',
|
||||||
|
action: async () => {
|
||||||
|
const content = await window.api.readFile(node.path)
|
||||||
|
const fileName = node.name.replace(/\.md$/, '')
|
||||||
|
await window.api.exportPDF(content, fileName)
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
if (node.type === 'directory') {
|
if (node.type === 'directory') {
|
||||||
|
|||||||
Reference in New Issue
Block a user