Fix some type errors

This commit is contained in:
Daniel Egger 2022-09-28 16:51:10 +02:00
parent bdae082550
commit 659684f25b
6 changed files with 12 additions and 15 deletions

View File

@ -3,7 +3,7 @@ import type { Circle } from '@/services/circle'
import ItFullScreenModal from '@/components/ui/ItFullScreenModal.vue'
const props = defineProps<{
circle: Circle
circle: Circle | undefined
show: boolean
}>()
@ -12,7 +12,7 @@ const props = defineProps<{
<template>
<ItFullScreenModal :show="show" @closemodal="$emit('closemodal')">
<div class="container-medium">
<div class="container-medium" v-if="circle">
<h1 class="">Überblick: Circle "{{ circle.title }}"</h1>
<p class="mt-8 text-xl">Hier zeigen wir dir, was du in diesem Circle lernen wirst.</p>

View File

@ -65,9 +65,6 @@ const block = computed(() => {
</iframe>
</div>
<div v-if="block.type === 'podcast'">
<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="" :src="block.value.url"></iframe>
</div>
</div>
</div>
</template>

View File

@ -9,6 +9,7 @@ import { useLearningPathStore } from '@/stores/learningPath'
export type CircleStoreState = {
circle: Circle | undefined
page: 'INDEX' | 'OVERVIEW'
}
export const useCircleStore = defineStore({
@ -16,6 +17,7 @@ export const useCircleStore = defineStore({
state: () => {
return {
circle: undefined,
page: 'INDEX',
} as CircleStoreState;
},
getters: {

View File

@ -4,6 +4,7 @@ import { LearningPath } from '@/services/learningPath'
export type LearningPathStoreState = {
learningPath: LearningPath | undefined
page: 'INDEX' | 'OVERVIEW'
}
export const useLearningPathStore = defineStore({
@ -11,6 +12,7 @@ export const useLearningPathStore = defineStore({
state: () => {
return {
learningPath: undefined,
page: 'INDEX',
} as LearningPathStoreState;
},
getters: {},

View File

@ -3,7 +3,6 @@ import * as log from 'loglevel'
import LearningSequence from '@/components/circle/LearningSequence.vue'
import CircleOverview from '@/components/circle/CircleOverview.vue'
import CircleDiagram from '@/components/circle/CircleDiagram.vue'
import LearningContent from '@/components/circle/LearningContent.vue'
import { computed, onMounted } from 'vue'
import { useCircleStore } from '@/stores/circle'
@ -65,10 +64,7 @@ onMounted(async () => {
/>
</Teleport>
<Transition mode="out-in">
<div v-if="circleStore.page === 'LEARNING_CONTENT'">
<LearningContent :key="circleStore.currentLearningContent.translation_key" />
</div>
<div v-else>
<div>
<div class="circle-container bg-gray-200">
<div class="circle max-w-9xl">
<div class="flex flex-col lg:flex-row">

View File

@ -7,7 +7,7 @@ import { useUserStore } from '@/stores/user'
import LearningPathDiagram from '@/components/circle/LearningPathDiagram.vue'
import LearningPathViewVertical from '@/views/LearningPathViewVertical.vue'
import { LearningPath } from '@/services/learningPath'
import type { LearningPath } from '@/services/learningPath'
log.debug('LearningPathView created')
@ -28,7 +28,7 @@ onMounted(async () => {
}
})
const createContinueUrl = (learningPath: LearningPath) => {
const createContinueUrl = (learningPath: LearningPath): [string, boolean] => {
if (learningPath.nextLearningContent) {
const circle = learningPath.nextLearningContent.parentCircle
const lsShortSlug = learningPath.nextLearningContent.parentLearningSequence?.slug.replace(`${circle.slug}-`, '')
@ -77,14 +77,14 @@ const createContinueUrl = (learningPath: LearningPath) => {
class="bg-white m-6 lg:m-12 p-8 flex flex-col lg:flex-row divide-y lg:divide-y-0 lg:divide-x divide-gray-500 justify-start"
>
<div class="p-4 lg:p-8 flex-auto">
<h2 translate>Willkommmen zurück, {{ userStore.first_name }}</h2>
<h2>Willkommmen zurück, {{ userStore.first_name }}</h2>
<p class="mt-4 text-xl"></p>
</div>
<div class="p-4 lg:p-8 flex-2" v-if="learningPathStore.learningPath.nextLearningContent" translate>
<div class="p-4 lg:p-8 flex-2" v-if="learningPathStore.learningPath.nextLearningContent">
Nächster Schritt
<h3>
{{ learningPathStore.learningPath.nextLearningContent.parentCircle.title }}:
{{ learningPathStore.learningPath.nextLearningContent.parentLearningSequence.title }}
{{ learningPathStore.learningPath.nextLearningContent.parentLearningSequence?.title }}
</h3>
<router-link
class="mt-4 btn-blue"