Enable click on draft quotes, fetch groups from contact modal

This commit is contained in:
Scott Nonnenberg 2021-05-21 10:27:28 -07:00 committed by GitHub
parent b878cad625
commit f6bc4dfe25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View file

@ -36,6 +36,7 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
removeMember: action('removeMember'),
showSafetyNumber: action('showSafetyNumber'),
toggleAdmin: action('toggleAdmin'),
updateSharedGroups: action('updateSharedGroups'),
});
story.add('As non-admin', () => {

View file

@ -21,6 +21,7 @@ export type PropsType = {
removeMember: (conversationId: string) => void;
showSafetyNumber: (conversationId: string) => void;
toggleAdmin: (conversationId: string) => void;
updateSharedGroups: () => void;
};
export const ContactModal = ({
@ -34,6 +35,7 @@ export const ContactModal = ({
removeMember,
showSafetyNumber,
toggleAdmin,
updateSharedGroups,
}: PropsType): ReactPortal | null => {
if (!contact) {
throw new Error('Contact modal opened without a matching contact');
@ -54,6 +56,11 @@ export const ContactModal = ({
};
}, []);
React.useEffect(() => {
// Kick off the expensive hydration of the current sharedGroupNames
updateSharedGroups();
}, [updateSharedGroups]);
React.useEffect(() => {
if (root !== null && closeButtonRef.current) {
closeButtonRef.current.focus();