@@ -153,7 +139,7 @@
variant="filled"
buttonColor={buttonColor}
onClick={onSaveAvatar}
- disabled={userAvatarSaveInProgress}
+ disabled={avatarSaveInProgress}
>
{saveButtonContent}
diff --git a/web/avatars/user-emoji-avatar-selection-modal.react.js b/web/avatars/user-emoji-avatar-selection-modal.react.js
new file mode 100644
--- /dev/null
+++ b/web/avatars/user-emoji-avatar-selection-modal.react.js
@@ -0,0 +1,43 @@
+// @flow
+
+import invariant from 'invariant';
+import * as React from 'react';
+
+import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js';
+import {
+ defaultAnonymousUserEmojiAvatar,
+ getAvatarForUser,
+ getDefaultAvatar,
+} from 'lib/shared/avatar-utils.js';
+import type {
+ ClientAvatar,
+ ClientEmojiAvatar,
+} from 'lib/types/avatar-types.js';
+
+import EmojiAvatarSelectionModal from './emoji-avatar-selection-modal.react.js';
+import { useSelector } from '../redux/redux-utils.js';
+
+function UserEmojiAvatarSelectionModal(): React.Node {
+ const editUserAvatarContext = React.useContext(EditUserAvatarContext);
+ invariant(editUserAvatarContext, 'editUserAvatarContext should be set');
+
+ const { baseSetUserAvatar, userAvatarSaveInProgress } = editUserAvatarContext;
+
+ const currentUserInfo = useSelector(state => state.currentUserInfo);
+ const currentUserAvatar: ClientAvatar = getAvatarForUser(currentUserInfo);
+
+ const defaultUserAvatar: ClientEmojiAvatar = currentUserInfo?.username
+ ? getDefaultAvatar(currentUserInfo.username)
+ : defaultAnonymousUserEmojiAvatar;
+
+ return (
+
+ );
+}
+
+export default UserEmojiAvatarSelectionModal;