diff --git a/CHANGELOG.md b/CHANGELOG.md index f990d4a..f64cc8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Version 0.1.15 + +### Fixed + +- fix responsive layout for header and coins page in small viewport + ## Version 0.1.14 ### Added diff --git a/components/CoinBalance.tsx b/components/CoinBalance.tsx index af142fe..2b4e22e 100644 --- a/components/CoinBalance.tsx +++ b/components/CoinBalance.tsx @@ -1,6 +1,6 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Coins } from 'lucide-react' -import { formatNumber } from '@/lib/utils/formatNumber' +import { FormattedNumber } from '@/components/FormattedNumber' import { useAtom } from 'jotai' import { settingsAtom } from '@/lib/atoms' import { useCoins } from '@/hooks/useCoins' @@ -18,12 +18,12 @@ export default function CoinBalance({ coinBalance }: { coinBalance: number }) {
- {formatNumber({ amount: coinBalance, settings })} + {coinsEarnedToday > 0 && (
- +{formatNumber({ amount: coinsEarnedToday, settings })} + + today diff --git a/components/CoinsManager.tsx b/components/CoinsManager.tsx index 04c7d9d..d5f8e25 100644 --- a/components/CoinsManager.tsx +++ b/components/CoinsManager.tsx @@ -3,7 +3,7 @@ import { useState } from 'react' import { t2d, d2s, getNow, isSameDate } from '@/lib/utils' import { Button } from '@/components/ui/button' -import { formatNumber } from '@/lib/utils/formatNumber' +import { FormattedNumber } from '@/components/FormattedNumber' import { History } from 'lucide-react' import EmptyState from './EmptyState' import { Input } from '@/components/ui/input' @@ -53,7 +53,7 @@ export default function CoinsManager() { 💰
Current Balance
-
{formatNumber({ amount: balance, settings })} coins
+
coins
@@ -107,19 +107,19 @@ export default function CoinsManager() { Statistics -
+
{/* Top Row - Totals */}
Total Earned
- {formatNumber({ amount: totalEarned, settings })} 🪙 + 🪙
Total Spent
- {formatNumber({ amount: totalSpent, settings })} 💸 + 💸
@@ -134,14 +134,14 @@ export default function CoinsManager() {
Today's Earned
- {formatNumber({ amount: coinsEarnedToday, settings })} 🪙 + 🪙
Today's Spent
- {formatNumber({ amount: coinsSpentToday, settings })} 💸 + 💸
diff --git a/components/FormattedNumber.tsx b/components/FormattedNumber.tsx new file mode 100644 index 0000000..ea3a608 --- /dev/null +++ b/components/FormattedNumber.tsx @@ -0,0 +1,16 @@ +import { formatNumber } from '@/lib/utils/formatNumber' +import { Settings } from '@/lib/types' + +interface FormattedNumberProps { + amount: number + settings: Settings + className?: string +} + +export function FormattedNumber({ amount, settings, className }: FormattedNumberProps) { + return ( + + {formatNumber({ amount, settings })} + + ) +} diff --git a/components/Header.tsx b/components/Header.tsx index 7164b02..447c06f 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -4,6 +4,7 @@ import { useState } from 'react' import { useAtom } from 'jotai' import { settingsAtom } from '@/lib/atoms' import { useCoins } from '@/hooks/useCoins' +import { FormattedNumber } from '@/components/FormattedNumber' import { Bell, Menu, Settings, User, Info, Coins } from 'lucide-react' import { Button } from '@/components/ui/button' import { Logo } from '@/components/Logo' @@ -30,19 +31,25 @@ export default function Header({ className }: HeaderProps) {
- + -
- +
+ -
- - {balance} - +
+ {coinsEarnedToday > 0 && ( - +{coinsEarnedToday} + )}
diff --git a/components/Layout.tsx b/components/Layout.tsx index 8f0eaa7..f119751 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -4,7 +4,7 @@ import Navigation from './Navigation' export default function Layout({ children }: { children: React.ReactNode }) { return ( -
+
diff --git a/package.json b/package.json index 0e88670..99a0c78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "habittrove", - "version": "0.1.14", + "version": "0.1.15", "private": true, "scripts": { "dev": "next dev --turbopack",