feat: alle functionaliteiten van de user homepage zijn geïmplementeerd

This commit is contained in:
Joyelle Ndagijimana 2025-03-21 16:32:12 +01:00
parent 54a2cf0800
commit 0d635fc6a1
6 changed files with 26 additions and 15 deletions

View file

@ -4,7 +4,7 @@
import { useI18n } from "vue-i18n";
import {AGE_TO_THEMES, THEMESITEMS} from "@/utils/constants.ts";
// Receive the selectedTheme from the parent component
// Receive the selectedTheme and selectedAge from the parent component
const props = defineProps({
selectedTheme: {
type: String,
@ -31,7 +31,6 @@
// Update the cards value with the fetched themes
allCards.value = await response.json();
cards.value = allCards.value;
//console.log(allCards.value);
} catch (error) {
console.error("Error fetching themes:", error);
}

View file

@ -1,18 +1,23 @@
<script setup lang="ts">
import { useI18n } from "vue-i18n";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const { t } = useI18n();
defineProps<{
path: string;
title: string;
description: string;
image: string;
}>();
defineProps<{
path: string;
title: string;
description: string;
image: string;
}>();
</script>
<template>
<v-card variant="outlined" class="theme-card d-flex flex-column">
<v-card
variant="outlined"
class="theme-card d-flex flex-column"
:to="`theme/${path}`"
link
>
<v-card-title class="title-container">
<v-img
v-if="image"
@ -39,6 +44,11 @@
flex-direction: column;
height: 100%;
padding: 1rem;
cursor: pointer;
}
.theme-card:hover {
background-color: rgba(0, 0, 0, 0.03);
}
.title-container {
@ -57,5 +67,8 @@
.title {
flex-grow: 1;
white-space: normal;
overflow-wrap: break-word;
word-break: break-word;
}
</style>

View file

@ -12,7 +12,7 @@
"choose-age": "Select age",
"theme-options": {
"all": "All themes",
"culture": "culture",
"culture": "Culture",
"electricity-and-mechanics": "Electricity and mechanics",
"nature-and-climate": "Nature and climate",
"agriculture": "Agriculture",

View file

@ -119,7 +119,7 @@ router.beforeEach(async (to, from, next) => {
// Verify if user is logged in before accessing certain routes
if (to.meta.requiresAuth) {
if (!authState.isLoggedIn.value) {
//next("/login");
//Next("/login");
next();
} else {
next();

View file

@ -3,7 +3,7 @@
</script>
<template>
<main></main>
</template>
<style scoped>

View file

@ -72,7 +72,6 @@ import {ref, watch} from "vue";
</v-container>
<BrowseThemes :selectedTheme="selectedThemeKey ?? ''" :selectedAge="selectedAgeKey ?? ''"/>
/>
</div>
</template>