feat: close modal after name change (#3084)

* feat: close modal after name change

* refactor: shortened modal name

* fix: added a no-op for NameChangeModal storybook
This commit is contained in:
Mohib Khan
2023-06-13 11:24:12 +05:30
committed by GitHub
parent f616f02be3
commit 6fa576a04a
3 changed files with 13 additions and 4 deletions

View File

@@ -86,6 +86,10 @@ export const UserDropdown: FC<UserDropdownProps> = ({
setShowNameChangeModal(true);
};
const closeChangeNameModal = () => {
setShowNameChangeModal(false);
};
// Register keyboard shortcut for the space bar to toggle playback
useHotkeys(
'c',
@@ -153,9 +157,9 @@ export const UserDropdown: FC<UserDropdownProps> = ({
<Modal
title="Change Chat Display Name"
open={showNameChangeModal}
handleCancel={() => setShowNameChangeModal(false)}
handleCancel={closeChangeNameModal}
>
<NameChangeModal />
<NameChangeModal closeModal={closeChangeNameModal} />
</Modal>
<Modal
title="Authenticate"