From 74e6cc31e83ad570a9f06765d288e9024736e73f Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Sat, 10 Apr 2021 21:35:13 -0500
Subject: Commit MVP

---
 src/views/About.vue | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

(limited to 'src/views/About.vue')

diff --git a/src/views/About.vue b/src/views/About.vue
index 3fa2807..ab4725e 100644
--- a/src/views/About.vue
+++ b/src/views/About.vue
@@ -1,5 +1,30 @@
 <template>
   <div class="about">
-    <h1>This is an about page</h1>
+    <router-link to="/editor">Create new database</router-link>
+    <file-upload
+      :accept="'application/json'"
+      @file-changed="handleDatabaseChange">Use existing database</file-upload>
   </div>
 </template>
+
+<script>
+import FileUpload from '../components/FileUpload.vue';
+
+import { parsePtDatabase } from '../features/parser';
+
+export default {
+  name: 'About',
+  components: {
+    FileUpload,
+  },
+  methods: {
+    handleDatabaseChange(files) {
+      parsePtDatabase(files[0]).then((result) => {
+        this.$store.commit('setLabs', result.labs);
+        this.$store.commit('setPeerTeachers', result.peerTeachers);
+        this.$router.push({ name: 'Editor' });
+      });
+    },
+  },
+};
+</script>
-- 
cgit v1.2.3

