chore: remove cumulative balance in spaces page
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m43s
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m43s
This commit is contained in:
parent
fb0cfb5a45
commit
ab74d46c28
4 changed files with 8 additions and 58 deletions
|
|
@ -1,16 +1,14 @@
|
|||
package blocks
|
||||
|
||||
import "github.com/shopspring/decimal"
|
||||
import "strings"
|
||||
import "git.juancwu.dev/juancwu/budgit/internal/ui/components/icon"
|
||||
import "fmt"
|
||||
import "git.juancwu.dev/juancwu/budgit/internal/routeurl"
|
||||
|
||||
type SpaceCardInfo struct {
|
||||
ID string
|
||||
Name string
|
||||
MemberCount int
|
||||
TotalBalance decimal.Decimal
|
||||
ID string
|
||||
Name string
|
||||
MemberCount int
|
||||
}
|
||||
|
||||
templ SpaceCard(info SpaceCardInfo) {
|
||||
|
|
@ -23,8 +21,6 @@ templ SpaceCard(info SpaceCardInfo) {
|
|||
<div>
|
||||
<p class="font-semibold">{ info.Name }</p>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
<span>${ info.TotalBalance.StringFixedBank(2) }</span>
|
||||
<span>•</span>
|
||||
<span>{ fmt.Sprintf("%d members", info.MemberCount) }</span>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,14 +9,11 @@ import (
|
|||
"git.juancwu.dev/juancwu/budgit/internal/ui/components/button"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/components/icon"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/layouts"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/utils"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type HomeProps struct {
|
||||
OwnedSpaces []blocks.SpaceCardInfo
|
||||
SharedSpaces []blocks.SpaceCardInfo
|
||||
TotalBalance decimal.Decimal
|
||||
}
|
||||
|
||||
templ Home(props HomeProps) {
|
||||
|
|
@ -36,14 +33,6 @@ templ Home(props HomeProps) {
|
|||
<h1 class="text-2xl font-bold">Hello, { displayName }</h1>
|
||||
if totalSpaces == 0 {
|
||||
<p class="text-muted-foreground">Create a space to start tracking your expenses.</p>
|
||||
} else {
|
||||
{{
|
||||
countPhrase := fmt.Sprintf("Across %d spaces", totalSpaces)
|
||||
if totalSpaces == 1 {
|
||||
countPhrase = "Across 1 space"
|
||||
}
|
||||
}}
|
||||
<p class="text-muted-foreground">{ countPhrase } you own you have <span class="font-medium text-foreground">${ utils.FormatDecimalWithThousands(props.TotalBalance.StringFixedBank(2)) }</span> tracked.</p>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package pages
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ctxkeys"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/routeurl"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/blocks"
|
||||
|
|
@ -10,11 +8,9 @@ import (
|
|||
"git.juancwu.dev/juancwu/budgit/internal/ui/components/icon"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/components/sidebar"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/layouts"
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ui/utils"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
templ Spaces(spaces []blocks.SpaceCardInfo, totalBalance decimal.Decimal) {
|
||||
templ Spaces(spaces []blocks.SpaceCardInfo) {
|
||||
{{
|
||||
user := ctxkeys.User(ctx)
|
||||
displayName := ""
|
||||
|
|
@ -30,14 +26,6 @@ templ Spaces(spaces []blocks.SpaceCardInfo, totalBalance decimal.Decimal) {
|
|||
<h1 class="text-2xl font-bold">Hello, { displayName }</h1>
|
||||
if len(spaces) == 0 {
|
||||
<p class="text-muted-foreground">Create a space to start tracking your expenses.</p>
|
||||
} else {
|
||||
{{
|
||||
countPhrase := fmt.Sprintf("Across %d spaces", len(spaces))
|
||||
if len(spaces) == 1 {
|
||||
countPhrase = "Across 1 space"
|
||||
}
|
||||
}}
|
||||
<p class="text-muted-foreground">{ countPhrase } you have <span class="font-medium text-foreground">${ utils.FormatDecimalWithThousands(totalBalance.StringFixedBank(2)) }</span> tracked.</p>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue