diff --git a/web/avatars/edit-user-avatar.css b/web/avatars/edit-user-avatar.css index dbfebbe88..9243b4515 100644 --- a/web/avatars/edit-user-avatar.css +++ b/web/avatars/edit-user-avatar.css @@ -1,12 +1,8 @@ .editUserAvatarContainer { position: relative; height: 112px; width: 112px; display: flex; justify-content: center; align-items: center; } - -.editAvatarLoadingSpinner { - position: absolute; -} diff --git a/web/avatars/edit-user-avatar.react.js b/web/avatars/edit-user-avatar.react.js index e6658a395..13bbe6438 100644 --- a/web/avatars/edit-user-avatar.react.js +++ b/web/avatars/edit-user-avatar.react.js @@ -1,38 +1,36 @@ // @flow import invariant from 'invariant'; import * as React from 'react'; import { EditUserAvatarContext } from 'lib/components/base-edit-user-avatar-provider.react.js'; import EditUserAvatarMenu from './edit-user-avatar-menu.react.js'; import css from './edit-user-avatar.css'; import UserAvatar from './user-avatar.react.js'; -import LoadingIndicator from '../loading-indicator.react.js'; - -const loadingSpinner = ; type Props = { +userID: ?string, +disabled?: boolean, }; function EditUserAvatar(props: Props): React.Node { const editUserAvatarContext = React.useContext(EditUserAvatarContext); invariant(editUserAvatarContext, 'editUserAvatarContext should be set'); const { userAvatarSaveInProgress } = editUserAvatarContext; const { userID } = props; return (
-
- {userAvatarSaveInProgress ? loadingSpinner : null} -
- + {!userAvatarSaveInProgress ? : null}
); } export default EditUserAvatar; diff --git a/web/avatars/user-avatar.react.js b/web/avatars/user-avatar.react.js index 94cfa9dc5..59ac3d7cc 100644 --- a/web/avatars/user-avatar.react.js +++ b/web/avatars/user-avatar.react.js @@ -1,31 +1,38 @@ // @flow import * as React from 'react'; import { getAvatarForUser, useENSResolvedAvatar, } from 'lib/shared/avatar-utils.js'; import Avatar from './avatar.react.js'; import { useSelector } from '../redux/redux-utils.js'; type Props = { +userID: ?string, +size: 'micro' | 'small' | 'large' | 'profile', + +showSpinner?: boolean, }; function UserAvatar(props: Props): React.Node { - const { userID, size } = props; + const { userID, size, showSpinner } = props; const userInfo = useSelector(state => userID ? state.userStore.userInfos[userID] : null, ); const avatarInfo = getAvatarForUser(userInfo); const resolvedUserAvatar = useENSResolvedAvatar(avatarInfo, userInfo); - return ; + return ( + + ); } export default UserAvatar;