Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3409067
D8279.id27979.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8279.id27979.diff
View Options
diff --git a/web/avatars/emoji-avatar-selection-modal.css b/web/avatars/emoji-avatar-selection-modal.css
--- a/web/avatars/emoji-avatar-selection-modal.css
+++ b/web/avatars/emoji-avatar-selection-modal.css
@@ -25,3 +25,10 @@
display: flex;
flex-direction: column;
}
+
+div.saveAvatarButtonContent {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ min-height: 24px;
+}
diff --git a/web/avatars/emoji-avatar-selection-modal.react.js b/web/avatars/emoji-avatar-selection-modal.react.js
--- a/web/avatars/emoji-avatar-selection-modal.react.js
+++ b/web/avatars/emoji-avatar-selection-modal.react.js
@@ -20,6 +20,7 @@
import Avatar from './avatar.react.js';
import css from './emoji-avatar-selection-modal.css';
import Button, { buttonThemes } from '../components/button.react.js';
+import LoadingIndicator from '../loading-indicator.react.js';
import Modal from '../modals/modal.react.js';
import ColorSelector from '../modals/threads/color-selector.react.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -30,7 +31,7 @@
const editUserAvatarContext = React.useContext(EditUserAvatarContext);
invariant(editUserAvatarContext, 'editUserAvatarContext should be set');
- const { setUserAvatar } = editUserAvatarContext;
+ const { setUserAvatar, userAvatarSaveInProgress } = editUserAvatarContext;
const currentUserInfo = useSelector(state => state.currentUserInfo);
const currentUserAvatar: ClientAvatar = getAvatarForUser(currentUserInfo);
@@ -69,6 +70,13 @@
[pendingEmojiAvatar, setUserAvatar],
);
+ let saveButtonContent;
+ if (userAvatarSaveInProgress) {
+ saveButtonContent = <LoadingIndicator status="loading" size="medium" />;
+ } else {
+ saveButtonContent = 'Save Avatar';
+ }
+
return (
<Modal
name="Emoji avatar selection"
@@ -93,8 +101,11 @@
variant="filled"
buttonColor={buttonThemes.standard}
onClick={onSaveAvatar}
+ disabled={userAvatarSaveInProgress}
>
- Save Avatar
+ <div className={css.saveAvatarButtonContent}>
+ {saveButtonContent}
+ </div>
</Button>
</div>
</div>
diff --git a/web/sidebar/community-creation/community-creation-modal.react.js b/web/sidebar/community-creation/community-creation-modal.react.js
--- a/web/sidebar/community-creation/community-creation-modal.react.js
+++ b/web/sidebar/community-creation/community-creation-modal.react.js
@@ -193,6 +193,7 @@
buttonColor={
errorMessage ? buttonThemes.danger : buttonThemes.standard
}
+ disabled={createNewCommunityLoadingStatus === 'loading'}
>
<div className={css.createCommunityButtonContent}>
{buttonContent}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 2:51 PM (7 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2617301
Default Alt Text
D8279.id27979.diff (2 KB)
Attached To
Mode
D8279: [web] Style and disable "Save Avatar" button when `userAvatarSaveInProgress`
Attached
Detach File
Event Timeline
Log In to Comment