-
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.
* Improve portfolio UI view * Properly rendering dates * Adding performance gain/loss on portfolio card * Added ui label for labeler
- Loading branch information
Showing
11 changed files
with
78 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ | |
|
||
"repl": | ||
- "repl/**/*" | ||
|
||
"ui": | ||
- "ui/**/*" |
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,16 @@ | ||
<script lang="ts"> | ||
export let date: Date | undefined; | ||
</script> | ||
|
||
{#if date} | ||
<time datetime={date.toISOString()}> | ||
{Intl.DateTimeFormat(navigator.language, { | ||
weekday: 'long', | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric' | ||
}).format(date)} | ||
</time> | ||
{:else} | ||
- | ||
{/if} |
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,31 @@ | ||
<script lang="ts"> | ||
import type { PortfolioSnapshot } from '$lib/gen/mgo_pb'; | ||
import { currency } from '$lib/intl'; | ||
import { ArrowTrendingUp, ArrowTrendingDown } from '@steeze-ui/heroicons'; | ||
import { Icon } from '@steeze-ui/svelte-icon'; | ||
export let snapshot: PortfolioSnapshot; | ||
export let icon: boolean = true; | ||
$: perf = | ||
((snapshot.totalMarketValue - snapshot.totalPurchaseValue) / snapshot.totalPurchaseValue) * 100; | ||
$: perfAbs = snapshot.totalMarketValue - snapshot.totalPurchaseValue; | ||
</script> | ||
|
||
<div | ||
class="{perf < 0 ? 'text-red-400' : 'text-green-400'} | ||
flex items-center" | ||
> | ||
{#if icon} | ||
<Icon | ||
src={perf > 0 ? ArrowTrendingUp : ArrowTrendingDown} | ||
class="{perf < 0 ? 'text-red-400' : 'text-green-400'} | ||
mr-1.5 h-5 w-5 flex-shrink-0" | ||
aria-hidden="true" | ||
/> | ||
{/if} | ||
{Intl.NumberFormat(navigator.language, { maximumFractionDigits: 2 }).format(perf)} % ({currency( | ||
perfAbs, | ||
'EUR' | ||
)}) | ||
</div> |
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
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