From 0dd5f8b8ff618b241d245cc5a65e3c4f92aad62f Mon Sep 17 00:00:00 2001 From: Kirill Date: Sun, 24 May 2026 19:42:17 +0500 Subject: [PATCH] perf: dynamic import dicebear avatar styles --- .../admin-settings/ui/AdminSettingsPage.tsx | 10 +- .../pages/me/ui/sections/AvatarSection.tsx | 10 +- client/src/shared/lib/avatar-styles.ts | 118 +++++++----------- client/src/shared/ui/UserAvatar.tsx | 32 +++-- 4 files changed, 75 insertions(+), 95 deletions(-) diff --git a/client/src/pages/admin-settings/ui/AdminSettingsPage.tsx b/client/src/pages/admin-settings/ui/AdminSettingsPage.tsx index bd805e5..2e59982 100644 --- a/client/src/pages/admin-settings/ui/AdminSettingsPage.tsx +++ b/client/src/pages/admin-settings/ui/AdminSettingsPage.tsx @@ -15,7 +15,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { useUnit } from 'effector-react' import { useForm } from 'react-hook-form' import { apiClient } from '@/shared/api/client' -import { AVATAR_STYLES, DEFAULT_STYLE_ID, getStyleById } from '@/shared/lib/avatar-styles' +import { AVATAR_STYLE_LOADERS, DEFAULT_STYLE_ID, loadAvatarStyle } from '@/shared/lib/avatar-styles' import { $user, updateProfileFx } from '@/shared/model/auth' import type { UpdateProfileParams } from '@/shared/model/auth' import { UserAvatar } from '@/shared/ui/UserAvatar' @@ -165,7 +165,7 @@ export function AdminSettingsPage() { Стиль