You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			903 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			37 lines
		
	
	
		
			903 B
		
	
	
	
		
			TypeScript
		
	
import React from 'react';
 | 
						|
import { animation, Item, Menu } from 'react-contexify';
 | 
						|
import { useDispatch } from 'react-redux';
 | 
						|
 | 
						|
import { SessionContextMenuContainer } from '../SessionContextMenuContainer';
 | 
						|
 | 
						|
import { hideMessageRequestBanner } from '../../state/ducks/userConfig';
 | 
						|
 | 
						|
export type PropsContextConversationItem = {
 | 
						|
  triggerId: string;
 | 
						|
};
 | 
						|
 | 
						|
const HideBannerMenuItem = (): JSX.Element => {
 | 
						|
  const dispatch = useDispatch();
 | 
						|
  return (
 | 
						|
    <Item
 | 
						|
      onClick={() => {
 | 
						|
        dispatch(hideMessageRequestBanner());
 | 
						|
      }}
 | 
						|
    >
 | 
						|
      {window.i18n('hideBanner')}
 | 
						|
    </Item>
 | 
						|
  );
 | 
						|
};
 | 
						|
 | 
						|
export const MessageRequestBannerContextMenu = (props: PropsContextConversationItem) => {
 | 
						|
  const { triggerId } = props;
 | 
						|
 | 
						|
  return (
 | 
						|
    <SessionContextMenuContainer>
 | 
						|
      <Menu id={triggerId} animation={animation.fade}>
 | 
						|
        <HideBannerMenuItem />
 | 
						|
      </Menu>
 | 
						|
    </SessionContextMenuContainer>
 | 
						|
  );
 | 
						|
};
 |