@@ -39,7 +29,7 @@ export default function JamLanding({ walletFileName }: JamLandingProps) {
) : (
- toggleDisplayMode()} className="flex cursor-pointer items-center gap-1">
+
toggleDisplayMode()} className="flex cursor-pointer items-center">
{formatAmount(totalBalance)}
{currencySymbol('lg')}
@@ -93,8 +83,7 @@ export default function JamLanding({ walletFileName }: JamLandingProps) {
name={jar.name}
amount={jar.balance}
color={jar.color}
- currency={currency}
- isPrivate={isPrivate}
+ currencySymbol={currencySymbol}
formatAmount={formatAmount}
totalBalance={totalBalance}
/>
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 6e4056c5..69ebe64c 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -70,7 +70,7 @@ export function Navbar({ theme, toggleTheme, formatAmount, currencySymbol, jars,
) : (
<>
-
{formatAmount(totalBalance)}
+
{formatAmount(totalBalance)}
{currencySymbol('sm')}
>
)}
diff --git a/src/components/layout/Jar.tsx b/src/components/layout/Jar.tsx
index cf75b5bd..44940540 100644
--- a/src/components/layout/Jar.tsx
+++ b/src/components/layout/Jar.tsx
@@ -1,27 +1,25 @@
-import type { Currency } from '@/hooks/useDisplaySettings'
-import { CurrencySymbol } from '../CurrencySymbol'
import { JarIcon } from '../ui/JarIcon'
interface JarProps {
name: string
amount: number
color: '#e2b86a' | '#3b5ba9' | '#c94f7c' | '#a67c52' | '#7c3fa6'
- currency: Currency
- isPrivate: boolean
formatAmount: (amount: number) => string
+ currencySymbol: (size: 'sm' | 'lg') => React.ReactNode
totalBalance?: number
}
-export function Jar({ name, amount, color, currency, isPrivate, formatAmount, totalBalance = 0 }: JarProps) {
+export function Jar({ name, amount, color, currencySymbol, formatAmount, totalBalance = 0 }: JarProps) {
return (
{name}
-
- {formatAmount(amount)}
-
+
+ {formatAmount(amount)}
+ {currencySymbol('sm')}
+
)
}
diff --git a/src/stories/Jar.stories.tsx b/src/stories/Jar.stories.tsx
index b6dcd279..b650589f 100644
--- a/src/stories/Jar.stories.tsx
+++ b/src/stories/Jar.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
+import { CurrencySymbol } from '@/components/CurrencySymbol'
import { Jar } from '@/components/layout/Jar'
import type { Currency } from '@/hooks/useDisplaySettings'
@@ -27,8 +28,7 @@ export const Sats: Story = {
name: 'Savings Jar',
amount: 15000000,
color: '#e2b86a',
- currency: 'sats',
- isPrivate: false,
+ currencySymbol: (size: 'sm' | 'lg') =>
,
formatAmount: () => formatAmount(15000000, 'sats'),
totalBalance: 50000000,
},
@@ -39,8 +39,7 @@ export const BTC: Story = {
name: 'Main Jar',
amount: 20000000,
color: '#3b5ba9',
- currency: 'btc',
- isPrivate: false,
+ currencySymbol: (size: 'sm' | 'lg') =>
,
formatAmount: () => formatAmount(20000000, 'btc'),
totalBalance: 50000000,
},
@@ -51,8 +50,7 @@ export const Empty: Story = {
name: 'Empty Jar',
amount: 0,
color: '#c94f7c',
- currency: 'sats',
- isPrivate: false,
+ currencySymbol: (size: 'sm' | 'lg') =>
,
formatAmount: () => formatAmount(0, 'sats'),
totalBalance: 50000000,
},
@@ -63,8 +61,7 @@ export const Full: Story = {
name: 'Full Jar',
amount: 50000000,
color: '#a67c52',
- currency: 'sats',
- isPrivate: false,
+ currencySymbol: (size: 'sm' | 'lg') =>
,
formatAmount: () => formatAmount(50000000, 'sats'),
totalBalance: 100000000,
},