mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
Allow creating new files (#437)
* allow creating new files * icon and translation key fix * Change how new file works * Fix selected file in tree view * Reword to "New empty file" * Reword to "Save as" --------- Co-authored-by: Flemmli97 <Flemmli97@users.noreply.github.com> Co-authored-by: Misode <misoloo64@gmail.com>
This commit is contained in:
@@ -124,8 +124,9 @@ export function ProjectPanel({ onRename, onCreate, onDeleteProject }: Props) {
|
||||
evt.preventDefault()
|
||||
setFocus()
|
||||
}
|
||||
|
||||
return <div class={`entry ${entry === selected ? 'active' : ''} ${focused ? 'focused' : ''}`} onClick={() => selectFile(entry)} onContextMenu={onContextMenu} >
|
||||
const file = disectEntry(entry)
|
||||
|
||||
return <div class={`entry ${file && getFilePath(file) === selected ? 'active' : ''} ${focused ? 'focused' : ''}`} onClick={() => selectFile(entry)} onContextMenu={onContextMenu} >
|
||||
{Octicon.file}
|
||||
<span>{entry.split('/').at(-1)}</span>
|
||||
{focused && <div class="entry-menu">
|
||||
@@ -135,7 +136,7 @@ export function ProjectPanel({ onRename, onCreate, onDeleteProject }: Props) {
|
||||
</div>)}
|
||||
</div>}
|
||||
</div>
|
||||
}, [actions])
|
||||
}, [actions, disectEntry])
|
||||
|
||||
return <>
|
||||
<div class="project-controls">
|
||||
|
||||
Reference in New Issue
Block a user