Enable click on draft quotes, fetch groups from contact modal
This commit is contained in:
parent
b878cad625
commit
f6bc4dfe25
5 changed files with 21 additions and 10 deletions
|
@ -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', () => {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue