diff options
Diffstat (limited to 'src/views/Start.vue')
| -rw-r--r-- | src/views/Start.vue | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/views/Start.vue b/src/views/Start.vue deleted file mode 100644 index f32c337..0000000 --- a/src/views/Start.vue +++ /dev/null @@ -1,52 +0,0 @@ -<template> - <div id="start"> - <router-link to="/editor"> - <UIButton>Create new database</UIButton> - </router-link> - <FileUpload - :accept="'application/json'" - @fileChanged="handleDatabaseChange">Use existing database</FileUpload> - </div> -</template> - -<script lang="ts"> -import { defineComponent } from 'vue'; -import FileUpload from '@/components/FileUpload.vue'; -import { parsePtDatabase } from '@/features/parser'; -import UIButton from '@/components/UIButton.vue'; - -export default defineComponent({ - name: 'Start', - components: { - FileUpload, - UIButton, - }, - methods: { - async handleDatabaseChange(files: File[]) { - const result = await parsePtDatabase(files[0]); - this.$store.commit('setLabs', result.labs); - this.$store.commit('setPeerTeachers', result.peerTeachers); - this.$router.push({ name: 'Editor' }); - }, - }, -}); -</script> - -<style> -#start { - align-items: center; - display: flex; - flex-direction: column; - font-size: 1.5rem; - height: 100vh; - justify-content: center; -} - -#start > * { - margin-top: 1em; -} - -#start > *:first-child { - margin-top: 0; -} -</style> |
