Skip to content

Commit d7f3c65

Browse files
refactor: address code review feedback (import formatting, simplified mock)
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/23985d64-7aff-4b70-b372-6d744998c1c8 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 0e63713 commit d7f3c65

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

apps/console/src/__tests__/HomeLayout.test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ vi.mock('@object-ui/auth', () => ({
2929
signOut: mockSignOut,
3030
isAuthenticated: true,
3131
}),
32-
getUserInitials: (u: any) => {
33-
if (!u?.name) return 'U';
34-
return u.name.split(' ').map((s: string) => s[0]).join('').toUpperCase().slice(0, 2);
35-
},
32+
getUserInitials: () => 'AD',
3633
}));
3734

3835
vi.mock('@object-ui/i18n', () => ({

apps/console/src/pages/home/HomeLayout.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ import { useObjectTranslation } from '@object-ui/i18n';
1515
import { useAuth, getUserInitials } from '@object-ui/auth';
1616
import {
1717
Button,
18-
DropdownMenu, DropdownMenuTrigger, DropdownMenuContent,
19-
DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator,
20-
DropdownMenuGroup, Avatar, AvatarImage, AvatarFallback,
18+
DropdownMenu,
19+
DropdownMenuTrigger,
20+
DropdownMenuContent,
21+
DropdownMenuItem,
22+
DropdownMenuLabel,
23+
DropdownMenuSeparator,
24+
DropdownMenuGroup,
25+
Avatar,
26+
AvatarImage,
27+
AvatarFallback,
2128
} from '@object-ui/components';
2229
import { Settings, LogOut, User, Home } from 'lucide-react';
2330

0 commit comments

Comments
 (0)