mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 07:42:23 +00:00
fix(ui): name the account by its display name
The dashboard greeting, the Insights greeting, the top bar and the sidebar read the username, so a display name set on the profile card reached the reports but none of the surfaces that address the account. They now read one helper that returns the display name when set and falls back to the username otherwise. Refs #1309
This commit is contained in:
1 parent
022c6de0b5
commit
1c4bcce6c7
7 files changed
+73
-17
No files matched your search
@@ -32,6 +32,7 @@ import {
|
||||
import { PageHeader } from "@/components/ui/page-header";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { accountName } from "@/lib/account-name";
|
||||
import { useMounted } from "@/hooks/use-mounted";
|
||||
import { useRecordCapabilities } from "@/hooks/use-record-capabilities";
|
||||
import { hourInTz } from "@/lib/tz/format";
|
||||
@@ -143,7 +144,7 @@ export function DashboardHeader({
|
||||
const greeting = greetingLine({
|
||||
greeting: timeGreeting,
|
||||
known: mounted && user != null,
|
||||
name: user?.username?.trim() ? user.username : null,
|
||||
name: user ? accountName(user).trim() || null : null,
|
||||
createdAt: user?.createdAt,
|
||||
});
|
||||
const welcomeText = t(greeting.key, greeting.values);
|
||||
|
||||
Reference in new issue
Block a user