From 987c652ca008805eefce6d629a24bcc074b6ea4a Mon Sep 17 00:00:00 2001 From: Rakantor Date: Sun, 13 Nov 2022 21:05:10 +0100 Subject: [PATCH] Refactor: mobile layout --- components/CourseList.vue | 15 +++++++-------- components/DemoInfoDialog.vue | 20 +++++++------------- pages/courses/_course/play.vue | 13 +++++++++---- pages/login.vue | 10 +++++++--- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/components/CourseList.vue b/components/CourseList.vue index a78eecf..9392fea 100644 --- a/components/CourseList.vue +++ b/components/CourseList.vue @@ -3,7 +3,7 @@ - + - + {{ id.toUpperCase() }} - {{ course.name }} + {{ course.name }} - + {{ isFavoriteCourse(id) ? 'mdi-heart' : 'mdi-heart-outline' }} @@ -51,16 +51,15 @@ export default { return this.$store.state.user.courses && this.$store.state.user.courses.includes(courseID) }, addToFavorites (courseID, add) { - const gameRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`) + const userRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`) - // Atomically add a new answer to the "player[ID]answers" array field. - updateDoc(gameRef, { + updateDoc(userRef, { kurse: add ? arrayUnion(courseID) : arrayRemove(courseID) }).then((empty) => { // Query execution was successful add ? this.$store.commit('addFavoriteCourse', courseID) : this.$store.commit('removeFavoriteCourse', courseID) }).catch((error) => { - // Failed to update the game; display error message + // Failed; display error message this.$toast({ content: error, color: 'error' }) }) } diff --git a/components/DemoInfoDialog.vue b/components/DemoInfoDialog.vue index b08d0f5..a638963 100644 --- a/components/DemoInfoDialog.vue +++ b/components/DemoInfoDialog.vue @@ -3,7 +3,7 @@