-
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 #14 from forevermatt/develop
Release 0.7.0
- Loading branch information
Showing
8 changed files
with
65 additions
and
30 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,31 @@ | ||
<script> | ||
import AmountInput from '../components/AmountInput.svelte' | ||
import Button from '../components/Button.svelte' | ||
import ButtonRow from '../components/ButtonRow.svelte' | ||
import { getBudgetedFor, setBudgetedForCategory } from '../data/budget' | ||
import { categories } from '../data/categories' | ||
import { faCheck, faTimes } from '@fortawesome/free-solid-svg-icons' | ||
import { push } from 'svelte-spa-router' | ||
export let params // URL parameters provider by router. | ||
$: uuid = params.uuid | ||
$: category = $categories.find(category => category.uuid === uuid) || {} | ||
$: initialAmount = getBudgetedFor(uuid) || 0 | ||
$: initialAmount = category && getBudgetedFor(uuid) || 0 | ||
function onSubmit(event) { | ||
let amount = event.detail | ||
setBudgetedForCategory(uuid, amount) | ||
let resultingAmount = 0 | ||
const onAmount = () => { | ||
setBudgetedForCategory(uuid, resultingAmount) | ||
push(`/budget`) | ||
} | ||
</script> | ||
|
||
<h2>Amount for {category.name}</h2> | ||
<h2>Monthly amount for {category.name}</h2> | ||
|
||
<AmountInput amount={initialAmount} on:next={onAmount} bind:resultingAmount={resultingAmount} /> | ||
|
||
<AmountInput amount={initialAmount} on:next={onSubmit} /> | ||
<ButtonRow> | ||
<Button icon={faCheck} name="save" on:click={onAmount} /> | ||
<Button icon={faTimes} name="cancel" url="#/budget" left /> | ||
</ButtonRow> |
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