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:
Shavonn Brown
2019-08-23 08:26:52 -04:00
committed by GitHub
parent e50a75f25f
commit 1c36542018
5 changed files with 87 additions and 39 deletions

View File

@@ -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} />
</>
);
}}