mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 08:26:51 +00:00
Project tree view and creation (#203)
* Implement creating and importing new projects * Add downloading a zip of a project * Project validation (WIP) * Add project side panel, remove project pages * Project file saving * Add file tree actions to rename and delete * Fix file creation auto focus * Add button to save file from menu * Add project creation * Fix specificity on version switcher button * Update default version to 1.19 * List project files by type, remember project and delete project
This commit is contained in:
27
src/app/components/generator/ProjectDeletion.tsx
Normal file
27
src/app/components/generator/ProjectDeletion.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Analytics } from '../../Analytics'
|
||||
import { useLocale, useProject } from '../../contexts'
|
||||
import { Btn } from '../Btn'
|
||||
import { Modal } from '../Modal'
|
||||
|
||||
interface Props {
|
||||
onClose: () => void,
|
||||
}
|
||||
export function ProjectDeletion({ onClose }: Props) {
|
||||
const { locale } = useLocale()
|
||||
const { projects, project, deleteProject } = useProject()
|
||||
|
||||
const doSave = () => {
|
||||
Analytics.deleteProject(projects.length, project.files.length, 'menu')
|
||||
deleteProject(project.name)
|
||||
onClose()
|
||||
}
|
||||
|
||||
return <Modal class="file-modal" onDismiss={onClose}>
|
||||
<p>{locale('project.delete_confirm.1', project.name)}</p>
|
||||
<p><b>{locale('project.delete_confirm.2')}</b></p>
|
||||
<div class="button-group">
|
||||
<Btn icon="trashcan" label={locale('project.delete')} onClick={doSave} class="danger" />
|
||||
<Btn label={locale('project.cancel')} onClick={onClose} />
|
||||
</div>
|
||||
</Modal>
|
||||
}
|
||||
Reference in New Issue
Block a user