ReactProfileWrapper.tsx 797 B

1234567891011121314151617181920212223242526
  1. import React from 'react';
  2. import { UserProvider } from 'app/core/utils/UserProvider';
  3. import { UserProfileEditForm } from './UserProfileEditForm';
  4. import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences';
  5. import { config } from '@grafana/runtime';
  6. export const ReactProfileWrapper = () => (
  7. <UserProvider userId={config.bootData.user.id}>
  8. {(api, states, user) => {
  9. return (
  10. <>
  11. {!states.loadUser && (
  12. <UserProfileEditForm
  13. updateProfile={api.updateUserProfile}
  14. isSavingUser={states.updateUserProfile}
  15. user={user}
  16. />
  17. )}
  18. <SharedPreferences resourceUri="user" />
  19. </>
  20. );
  21. }}
  22. </UserProvider>
  23. );
  24. export default ReactProfileWrapper;