From eb0143f132566874045bbd15b80a60a50c06ae8c Mon Sep 17 00:00:00 2001 From: whekin Date: Mon, 9 Mar 2026 17:12:21 +0400 Subject: [PATCH] refactor(miniapp): remove placeholder shell cards --- apps/miniapp/src/App.tsx | 120 ++++++++++++++++++++++++++----------- apps/miniapp/src/i18n.ts | 59 +++++++++--------- apps/miniapp/src/index.css | 31 +++++++++- 3 files changed, 146 insertions(+), 64 deletions(-) diff --git a/apps/miniapp/src/App.tsx b/apps/miniapp/src/App.tsx index 2e930ae..f891cb4 100644 --- a/apps/miniapp/src/App.tsx +++ b/apps/miniapp/src/App.tsx @@ -107,6 +107,14 @@ function joinDeepLink(): string | null { return `https://t.me/${context.botUsername}?start=join_${encodeURIComponent(context.joinToken)}` } +function dashboardMemberCount(dashboard: MiniAppDashboard | null): string { + return dashboard ? String(dashboard.members.length) : '—' +} + +function dashboardLedgerCount(dashboard: MiniAppDashboard | null): string { + return dashboard ? String(dashboard.ledger.length) : '—' +} + function App() { const [locale, setLocale] = createSignal('en') const [session, setSession] = createSignal({ @@ -479,6 +487,12 @@ function App() { case 'house': return readySession()?.member.isAdmin ? (
+
+
+ {copy().householdSettingsTitle} +
+

{copy().householdSettingsBody}

+
{copy().householdLanguage} @@ -544,22 +558,75 @@ function App() { )}
) : ( - copy().houseEmpty +
+
+
+ {copy().residentHouseTitle} +
+

{copy().residentHouseBody}

+
+
) default: return ( - {copy().summaryBody}

} - render={(data) => ( - <> -

- {copy().totalDue}: {data.totalDueMajor} {data.currency} -

-

{copy().summaryBody}

- - )} - /> +
+
+ {copy().totalDue} + + {dashboard() ? `${dashboard()!.totalDueMajor} ${dashboard()!.currency}` : '—'} + +
+
+ {copy().membersCount} + {dashboardMemberCount(dashboard())} +
+
+ {copy().ledgerEntries} + {dashboardLedgerCount(dashboard())} +
+ {readySession()?.member.isAdmin ? ( +
+ {copy().pendingRequests} + {String(pendingMembers().length)} +
+ ) : null} + +
+
+ {copy().overviewTitle} +
+

{copy().overviewBody}

+
+ +
+
+ {copy().latestActivityTitle} +
+ {copy().latestActivityEmpty}

} + render={(data) => + data.ledger.length === 0 ? ( +

{copy().latestActivityEmpty}

+ ) : ( +
+ {data.ledger.slice(0, 3).map((entry) => ( +
+
+ {entry.title} + + {entry.amountMajor} {data.currency} + +
+

{entry.actorDisplayName ?? 'Household'}

+
+ ))} +
+ ) + } + /> +
+
) } } @@ -601,7 +668,7 @@ function App() {
- {copy().navHint} + {copy().loadingBadge}

{copy().loadingTitle}

{copy().loadingBody}

@@ -609,7 +676,7 @@ function App() {
- {copy().navHint} + {copy().loadingBadge}

{blockedSession()?.reason === 'telegram_only' ? copy().telegramOnlyTitle @@ -628,7 +695,7 @@ function App() {
- {copy().navHint} + {copy().loadingBadge}

{onboardingSession()?.mode === 'pending' ? copy().pendingTitle @@ -681,7 +748,7 @@ function App() {
- {readySession()?.mode === 'demo' ? copy().demoBadge : copy().navHint} + {readySession()?.mode === 'demo' ? copy().demoBadge : copy().liveBadge} {readySession()?.member.isAdmin ? copy().adminTag : copy().residentTag} @@ -692,7 +759,7 @@ function App() { {copy().welcome},{' '} {readySession()?.telegramUser.firstName ?? readySession()?.member.displayName}

-

{copy().sectionBody}

+

{copy().overviewBody}