-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from leon-luna-ray/dev
Dev
- Loading branch information
Showing
21 changed files
with
512 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<form @submit.prevent="budgetStore.postNewBudget" class="flex-col-1"> | ||
<label for="description">Title</label> | ||
<input type="text" id="title" v-model="budgetFormData.title"> | ||
|
||
<label for="description">Description</label> | ||
<input type="text" id="description" v-model="budgetFormData.description"> | ||
|
||
<label for="amount">Amount</label> | ||
<input type="number" id="amount" v-model="budgetFormData.amount" required> | ||
|
||
<label for="localCurrency">Local Currency:</label> | ||
<input type="text" id="localCurrency" v-model="budgetFormData.localCurrency"> | ||
|
||
<button type="submit">Submit</button> | ||
</form> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from 'pinia'; | ||
import { useBudgetStore } from '@/stores/budget'; | ||
const budgetStore = useBudgetStore(); | ||
const { budgetFormData } = storeToRefs(budgetStore); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="currentColor" | ||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> | ||
<!-- Box --> | ||
<rect x="4" y="2" width="16" height="20" rx="2" ry="2" /> | ||
|
||
<!-- Receipt lines --> | ||
<line x1="4" y1="6" x2="20" y2="6" /> | ||
<line x1="4" y1="10" x2="20" y2="10" /> | ||
<line x1="4" y1="14" x2="20" y2="14" /> | ||
|
||
<!-- Dollar sign --> | ||
<line x1="12" y1="16" x2="12" y2="18" /> | ||
<line x1="11" y1="17" x2="13" y2="17" /> | ||
</svg> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const formatTimestamp = (timestamp) => { | ||
const options = { day: 'numeric', month: 'short', year: 'numeric' }; | ||
const formattedDate = new Date(timestamp).toLocaleDateString(undefined, options); | ||
return formattedDate; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div v-if="budgetDetailData" class="container flex-col-1"> | ||
<h1>Budget Detail</h1> | ||
<div class="flex-col-03"> | ||
<h2>{{ budgetDetailData.title }}</h2> | ||
<p>{{ budgetDetailData.description }}</p> | ||
<p>{{ formatTimestamp(budgetDetailData.createdAt) }}</p> | ||
<p>Currency: {{ budgetDetailData.localCurrency }}</p> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { onMounted } from 'vue'; | ||
import { storeToRefs } from 'pinia'; | ||
import { useRoute } from 'vue-router'; | ||
import { useBudgetStore } from '@/stores/budget'; | ||
import { formatTimestamp } from '@/lib/date' | ||
const route = useRoute(); | ||
const budgetStore = useBudgetStore(); | ||
const { budgetDetailData } = storeToRefs(budgetStore); | ||
onMounted(async () => { | ||
await budgetStore.fetchBudgetDetail(route.params.id); | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.