The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/mocks/client/ModalContextMock.tsx

22 lines
564 B

import { ModalContext } from '@rocket.chat/ui-contexts';
import type { ReactElement, ContextType, ReactNode } from 'react';
import React, { useMemo } from 'react';
type ModalContextMockProps = {
children: ReactNode;
};
const ModalContextMock = ({ children }: ModalContextMockProps): ReactElement => {
const value = useMemo(
() => ({
modal: {
setModal: (): void => undefined,
},
}),
[],
);
return <ModalContext.Provider children={children} value={value as unknown as ContextType<typeof ModalContext>} />;
};
export default ModalContextMock;