mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
convert teams section of user profile to react (#18633)
* convert teams section of user profile to react * isLoading prop * loading placeholders
This commit is contained in:
@@ -2,14 +2,18 @@ import React from 'react';
|
||||
import { UserProvider } from 'app/core/utils/UserProvider';
|
||||
import { UserProfileEditForm } from './UserProfileEditForm';
|
||||
import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences';
|
||||
import { UserTeams } from './UserTeams';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { LoadingPlaceholder } from '@grafana/ui';
|
||||
|
||||
export const ReactProfileWrapper = () => (
|
||||
<UserProvider userId={config.bootData.user.id}>
|
||||
{(api, states, user) => {
|
||||
{(api, states, teams, user) => {
|
||||
return (
|
||||
<>
|
||||
{!states.loadUser && (
|
||||
{states.loadUser ? (
|
||||
<LoadingPlaceholder text="Loading user profile..." />
|
||||
) : (
|
||||
<UserProfileEditForm
|
||||
updateProfile={api.updateUserProfile}
|
||||
isSavingUser={states.updateUserProfile}
|
||||
@@ -17,6 +21,7 @@ export const ReactProfileWrapper = () => (
|
||||
/>
|
||||
)}
|
||||
<SharedPreferences resourceUri="user" />
|
||||
<UserTeams isLoading={states.loadTeams} loadTeams={api.loadTeams} teams={teams} />
|
||||
</>
|
||||
);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user