GroupsV2: Better group invite behavior
This commit is contained in:
parent
b9ff4f07d3
commit
d51a0b5ece
24 changed files with 1408 additions and 313 deletions
35
ts/components/ProgressModal.tsx
Normal file
35
ts/components/ProgressModal.tsx
Normal file
|
@ -0,0 +1,35 @@
|
|||
import * as React from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { ProgressDialog } from './ProgressDialog';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
|
||||
export type PropsType = {
|
||||
readonly i18n: LocalizerType;
|
||||
};
|
||||
|
||||
export const ProgressModal = React.memo(({ i18n }: PropsType) => {
|
||||
const [root, setRoot] = React.useState<HTMLElement | null>(null);
|
||||
|
||||
// Note: We explicitly don't register for user interaction here, since this dialog
|
||||
// cannot be dismissed.
|
||||
|
||||
React.useEffect(() => {
|
||||
const div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
setRoot(div);
|
||||
|
||||
return () => {
|
||||
document.body.removeChild(div);
|
||||
setRoot(null);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return root
|
||||
? createPortal(
|
||||
<div role="presentation" className="module-progress-dialog__overlay">
|
||||
<ProgressDialog i18n={i18n} />
|
||||
</div>,
|
||||
root
|
||||
)
|
||||
: null;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue