Skip to content

Commit

Permalink
fix: Resolved issues from pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanni8 committed Dec 16, 2024
1 parent da84a38 commit 7c81545
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
39 changes: 28 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
<style>
html,body ,#app{
html,
body,
#app {
width: 100%;
height: 100%;
}

body,
p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
a {
color: white;
}
</style>
26 changes: 14 additions & 12 deletions src/components/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<template>
<div class="h-full w-full flex justify-center items-center bg-[#141e36] flex-col">
<h1 class="text-5xl bg-transparent text-white mb-8">Dashboard</h1>
<h2 class="text-3xl text-white italic mb-4">Total amount: {{ totalAmount }}</h2>
<h3 class="text-2xl text-white italic">Transaktonen</h3>
<div class="h-full w-full flex justify-center items-center bg-black flex-col">
<h1 class="text-5xl bg-transparent mb-8">Insimodus</h1>
<h2 class="text-3xl italic mb-4">Total amount: {{ totalAmount }}</h2>
<h3 class="text-2xl italic">Transaktionen</h3>
<div class="h-3/4 py-12 w-1/2">
<div v-for="transaction in transactions" class="p-4 flex justify-between w-full" v-bind:key="transaction.id">
<span class="text-white">{{ transaction.title }}</span>
<span class="text-white">{{ transaction.positiv ? "+" : "-" }}{{ transaction.amount }}</span>
<div v-for="transaction in transactions" class="p-4 flex justify-between w-full"
v-bind:key="transaction.id">
<span class="">{{ transaction.title }}</span>
<span class="">{{ transaction.positiv ? "+" : "-" }}{{ transaction.amount }}</span>
</div>
<div class="mt-4 flex justify-center items-center w-full h-10 border rounded-lg border-dashed cursor-pointer" @click="addTransaction">
<span class="text-white text-2xl">+</span>
<div class="mt-4 flex justify-center items-center w-full h-10 border rounded-lg border-dashed cursor-pointer"
@click="addTransaction">
<span class=" text-2xl">+</span>
</div>
</div>
</div>
Expand All @@ -20,7 +22,7 @@ import { getTransactions } from '@/service/data';
export default {
name: "InsimodusDashboard",
data(){
data() {
return {
transactions: [] as Transaction[]
}
Expand All @@ -29,15 +31,15 @@ export default {
this.transactions = getTransactions();
},
computed: {
totalAmount(){
totalAmount() {
let sum = 0;
this.transactions.map(transaction => sum += transaction.positiv ? transaction.amount : -transaction.amount)
return sum
}
},
methods: {
addTransaction(){
addTransaction() {
window.location.href = "/add";
}
}
Expand Down

0 comments on commit 7c81545

Please sign in to comment.