Refactor personal account components for data fetching efficiency
Refactored personal account components to centralize user data fetching and subsequently reduce and distribute calls. Instead of fetching user data individually in `UpdateAccountImageContainer`, `UpdateAccountDetailsFormContainer` and `UpdateAccountNameFormContainer`, data fetching is now performed in the parent component, `AccountSettingsContainer`. Also, implemented partial loading state.
This commit is contained in:
@@ -68,7 +68,7 @@ export function PersonalAccountDropdown({
|
||||
}, [user?.email, user?.phone]);
|
||||
|
||||
const displayName =
|
||||
account?.name ?? personalAccountData?.name ?? user?.email ?? '';
|
||||
personalAccountData?.name ?? account?.name ?? user?.email ?? '';
|
||||
|
||||
const isSuperAdmin = useMemo(() => {
|
||||
return user?.app_metadata.role === 'super-admin';
|
||||
|
||||
Reference in New Issue
Block a user