Share cards compartibles: brand header grande, fecha, Dark/Light (build 83) #35

- Header de marca arriba, grande (logo BrandMark 48px + nombre title2 rounded),
  nunca se corta en Story (9:16 real 360x640, Post 4:5 360x450).
- Héroe = retorno % (privacy/branding-friendly), valor como apoyo.
- Fecha del último check-in bajo el nombre (share_as_of) para dar contexto a
  quien no conoce la app; DashboardViewModel.shareAsOfDate.
- Tema Dark + Light (ShareCardTheme) con selector en el sheet + preview vivo.
- Sparkline real (viewModel.evolutionData), ya se pasaba.
- CTA de descarga + QR con ct=snapshot_share (atribución App Analytics).
- L10n x7 (as_of, theme_dark/light, cta, hero, metrics).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L38583J7AYWCVPevkivscj
This commit is contained in:
alexandrev-tibco
2026-08-07 09:45:10 +02:00
parent 8084bc6a82
commit 3b1f62cc26
12 changed files with 326 additions and 113 deletions
@@ -809,4 +809,15 @@ class DashboardViewModel: ObservableObject {
var formattedLastUpdate: String {
portfolioSummary.lastUpdated?.friendlyDescription ?? "Not yet"
}
/// Absolute last-check-in date (e.g. "7 Aug 2026") for the share card an
/// outsider needs a concrete date, not "2 days ago".
var shareAsOfDate: String? {
guard let date = portfolioSummary.lastUpdated else { return nil }
let f = DateFormatter()
f.locale = .autoupdatingCurrent
f.dateStyle = .medium
f.timeStyle = .none
return f.string(from: date)
}
}