Dismiss the avatar menu after selecting "Update Signal"

This commit is contained in:
Jordan Rose 2023-05-17 10:50:47 -07:00 committed by GitHub
parent 6e5d9f5dd8
commit 2ee15cdfa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -45,12 +45,12 @@ const useProps = (overrideProps: Partial<Props> = {}): Props => ({
isMe: true,
noteToSelf: boolean('noteToSelf', overrideProps.noteToSelf || false),
onEditProfile: action('onEditProfile'),
onStartUpdate: action('startUpdate'),
onViewArchive: action('onViewArchive'),
onViewPreferences: action('onViewPreferences'),
phoneNumber: text('phoneNumber', overrideProps.phoneNumber || ''),
profileName: text('profileName', overrideProps.profileName || ''),
sharedGroupNames: [],
startUpdate: action('startUpdate'),
style: {},
theme: React.useContext(StorybookThemeContext),
title: text('title', overrideProps.title || ''),

View file

@ -16,9 +16,9 @@ export type Props = {
readonly theme: ThemeType;
hasPendingUpdate: boolean;
startUpdate: () => unknown;
onEditProfile: () => unknown;
onStartUpdate: () => unknown;
onViewPreferences: () => unknown;
onViewArchive: () => unknown;
@ -34,11 +34,11 @@ export function AvatarPopup(props: Props): JSX.Element {
i18n,
name,
onEditProfile,
onStartUpdate,
onViewArchive,
onViewPreferences,
phoneNumber,
profileName,
startUpdate,
style,
title,
} = props;
@ -105,7 +105,7 @@ export function AvatarPopup(props: Props): JSX.Element {
<button
type="button"
className="module-avatar-popup__item"
onClick={startUpdate}
onClick={onStartUpdate}
>
<div
className={classNames(

View file

@ -173,13 +173,16 @@ export function MainHeader({
title={title}
avatarPath={avatarPath}
hasPendingUpdate={hasPendingUpdate}
startUpdate={startUpdate}
// See the comment above about `sharedGroupNames`.
sharedGroupNames={[]}
onEditProfile={() => {
toggleProfileEditor();
setShowAvatarPopup(false);
}}
onStartUpdate={() => {
startUpdate();
setShowAvatarPopup(false);
}}
onViewPreferences={() => {
showSettings();
setShowAvatarPopup(false);