Skip to content
Snippets Groups Projects
Commit f8f9e385 authored by Henrik's avatar Henrik
Browse files

Merge remote-tracking branch 'origin/feat/profile-and-settings-improvements'...

Merge remote-tracking branch 'origin/feat/profile-and-settings-improvements' into feat/profile-and-settings-improvements
parents 28e21b03 ac1b1184
No related branches found
No related tags found
1 merge request!106Feat/profile and settings improvements
<!-- ConfirmationModal.vue -->
<template>
<div class="modal" :id="modalId" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true"
data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLabel">{{ title }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ message }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ cancelButtonText }}</button>
<button type="button" class="btn btn-primary" @click="confirmAction">{{ confirmButtonText }}</button>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
const modalId = ref(null);
const title = 'Confirm Action';
const message = 'Are you sure you want to proceed?';
const confirmButtonText = 'Confirm';
const cancelButtonText = 'Cancel';
// Methods
function confirmAction() {
emit('confirm');
}
</script>
\ No newline at end of file
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<div class="container d-flex justify-content-center"> <div class="container d-flex justify-content-center">
<div class="row col-md-10"> <div class="row col-md-10">
<div class="col-md-12"> <div class="col-md-12">
<h1>Stash</h1> <h1>Utvidelser</h1>
<div class="category row mb-2 m-2"> <div class="category row mb-2 m-2">
<div class="card text-center justify-content-center align-items-center" style="width: 8rem; border: none"> <div class="card text-center justify-content-center align-items-center" style="width: 8rem; border: none">
<img src="../../assets/items/adfree.png" class="card-img-top" alt="..." <img src="../../assets/items/adfree.png" class="card-img-top" alt="..."
style="width: 100px; height: 100px;" /> style="width: 100px; height: 100px;" />
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Adfree</h5> <h5 class="card-title">Reklamefri</h5>
<button type="button" class="btn btn-primary" id="buttonStyle" data-toggle="modal" <button type="button" class="btn btn-primary" id="buttonStyle" data-toggle="modal"
data-target="#adfreeModal"> data-target="#adfreeModal">
+35kr +35kr
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<h1>Items</h1> <h1>Banner</h1>
<div class="category row mb-2 m-2"> <div class="category row mb-2 m-2">
<div v-for="product in products" :key="product.id" <div v-for="product in products" :key="product.id"
class="card text-center d-flex justify-content-center align-items-center" class="card text-center d-flex justify-content-center align-items-center"
...@@ -47,24 +47,24 @@ ...@@ -47,24 +47,24 @@
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{{ product.itemName }}</h5> <h5 class="card-title">{{ product.itemName }}</h5>
<h6>{{ product.price }}<img src="../../assets/items/pigcoin.png" style="width: 2rem" /></h6> <h6>{{ product.price }}<img src="../../assets/items/pigcoin.png" style="width: 2rem" /></h6>
<ShopButton v-if="!product.alreadyBought" button-text="Buy item" :disabled="product.price > points" <ShopButton v-if="!product.alreadyBought" button-text="Kjøp gjennstand" :disabled="product.price > points"
@click="buyItem(product.id)" /> @click="buyItem(product.id)" />
<p v-else>Owned</p> <p v-else>Eid</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<h1>Cool items</h1> <h1>Tjenester</h1>
<div class="category row mb-2 m-2"> <div class="category row mb-2 m-2">
<div class="card text-center d-flex justify-content-center align-items-center" <div class="card text-center d-flex justify-content-center align-items-center"
style="width: 8rem; border: none"> style="width: 8rem; border: none">
<img src="../../assets/items/coffee.jpg" class="card-img-top" alt="..." <img src="../../assets/items/coffee.jpg" class="card-img-top" alt="..."
style="width: 100px; height: 100px;"> style="width: 100px; height: 100px;">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Free Coffee</h5> <h5 class="card-title">Gratis kaffe</h5>
<h6>500<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6> <h6>500<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6>
<ShopButton button-text="Buy item" :disabled="500 > points" @click="buySomething()" /> <ShopButton button-text="Kjøp gjennstand" :disabled="500 > points" @click="buySomething()" />
</div> </div>
</div> </div>
<div class="card text-center d-flex justify-content-center align-items-center" <div class="card text-center d-flex justify-content-center align-items-center"
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
<img src="../../assets/items/viaplay.jpg" class="card-img-top" alt="..." <img src="../../assets/items/viaplay.jpg" class="card-img-top" alt="..."
style="width: 100px; height: 100px;"> style="width: 100px; height: 100px;">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">1 Month</h5> <h5 class="card-title">1 Måned</h5>
<h6>10 000<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6> <h6>10 000<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6>
<ShopButton button-text="Buy item" :disabled="10000 > points" @click="buySomething()" /> <ShopButton button-text="Kjøp gjennstand" :disabled="10000 > points" @click="buySomething()" />
</div> </div>
</div> </div>
<div class="card text-center d-flex justify-content-center align-items-center" <div class="card text-center d-flex justify-content-center align-items-center"
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<div class="card-body"> <div class="card-body">
<h5 class="card-title">-10% rabatt</h5> <h5 class="card-title">-10% rabatt</h5>
<h6>1000<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6> <h6>1000<img src="../../assets/items/pigcoin.png" style="width: 2rem"></h6>
<ShopButton button-text="Buy item" :disabled="1000 > points" @click="buySomething()" /> <ShopButton button-text="Kjøp gjennstand" :disabled="1000 > points" @click="buySomething()" />
</div> </div>
</div> </div>
</div> </div>
...@@ -157,7 +157,7 @@ import handleUnknownError from '@/components/Exceptions/unkownErrorHandler'; ...@@ -157,7 +157,7 @@ import handleUnknownError from '@/components/Exceptions/unkownErrorHandler';
let apiUrl = import.meta.env.VITE_APP_API_URL; let apiUrl = import.meta.env.VITE_APP_API_URL;
const products = ref([] as any); const products = ref([] as any);
const points = ref(); const points = ref(0 as any);
/** /**
* Retrieves the store's products and updates the products list. * Retrieves the store's products and updates the products list.
...@@ -178,7 +178,9 @@ const getStore = async () => { ...@@ -178,7 +178,9 @@ const getStore = async () => {
const getPoints = async () => { const getPoints = async () => {
try { try {
const response = await UserService.getUser(); const response = await UserService.getUser();
points.value = response.point?.currentPoints; if (response.point?.currentPoints !== null) {
points.value = response.point?.currentPoints;
}
} catch (error) { } catch (error) {
handleUnknownError(error); handleUnknownError(error);
console.log(error); console.log(error);
......
...@@ -334,7 +334,7 @@ const toUpdateUserSettings = () => { ...@@ -334,7 +334,7 @@ const toUpdateUserSettings = () => {
height: 200px; height: 200px;
} }
@media (max-width: 940px) { @media (max-width: 980px) {
#banner { #banner {
height: 320px; height: 320px;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment