GroupsV2: Better group invite behavior
This commit is contained in:
		
					parent
					
						
							
								b9ff4f07d3
							
						
					
				
			
			
				commit
				
					
						d51a0b5ece
					
				
			
		
					 24 changed files with 1408 additions and 313 deletions
				
			
		
							
								
								
									
										46
									
								
								ts/components/ErrorModal.tsx
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								ts/components/ErrorModal.tsx
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,46 @@
 | 
			
		|||
import * as React from 'react';
 | 
			
		||||
 | 
			
		||||
import { LocalizerType } from '../types/Util';
 | 
			
		||||
import { ConfirmationModal } from './ConfirmationModal';
 | 
			
		||||
 | 
			
		||||
export type PropsType = {
 | 
			
		||||
  buttonText: string;
 | 
			
		||||
  description: string;
 | 
			
		||||
  title: string;
 | 
			
		||||
 | 
			
		||||
  onClose: () => void;
 | 
			
		||||
  i18n: LocalizerType;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function focusRef(el: HTMLElement | null) {
 | 
			
		||||
  if (el) {
 | 
			
		||||
    el.focus();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const ErrorModal = (props: PropsType): JSX.Element => {
 | 
			
		||||
  const { buttonText, description, i18n, onClose, title } = props;
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <ConfirmationModal
 | 
			
		||||
      actions={[]}
 | 
			
		||||
      title={title || i18n('ErrorModal--title')}
 | 
			
		||||
      i18n={i18n}
 | 
			
		||||
      onClose={onClose}
 | 
			
		||||
    >
 | 
			
		||||
      <div className="module-error-modal__description">
 | 
			
		||||
        {description || i18n('ErrorModal--description')}
 | 
			
		||||
      </div>
 | 
			
		||||
      <div className="module-error-modal__button-container">
 | 
			
		||||
        <button
 | 
			
		||||
          type="button"
 | 
			
		||||
          className="module-confirmation-dialog__container__buttons__button"
 | 
			
		||||
          onClick={onClose}
 | 
			
		||||
          ref={focusRef}
 | 
			
		||||
        >
 | 
			
		||||
          {buttonText || i18n('ErrorModal--buttonText')}
 | 
			
		||||
        </button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </ConfirmationModal>
 | 
			
		||||
  );
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue