Skip to content

Commit 56d8b41

Browse files
committed
feat: promote GlobalModal to be the default component for displaying modals
1 parent 534f562 commit 56d8b41

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/MessageBounce/MessageBounceModal.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { ComponentType, PropsWithChildren } from 'react';
22
import React from 'react';
3-
import type { ModalProps } from '../Modal';
4-
import { Modal as DefaultModal } from '../Modal';
3+
import { GlobalModal, type ModalProps } from '../Modal';
54
import { MessageBounceProvider, useComponentContext } from '../../context';
65
import type { MessageBouncePromptProps } from './MessageBouncePrompt';
76

@@ -15,7 +14,7 @@ export function MessageBounceModal({
1514
MessageBouncePrompt,
1615
...modalProps
1716
}: MessageBounceModalProps) {
18-
const { Modal = DefaultModal } = useComponentContext();
17+
const { Modal = GlobalModal } = useComponentContext();
1918
return (
2019
<Modal className='str-chat__message-bounce-modal' {...modalProps}>
2120
<MessageBounceProvider>

src/components/Reactions/ReactionsListModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import clsx from 'clsx';
33

44
import type { ReactionDetailsComparator, ReactionSummary, ReactionType } from './types';
55

6-
import { Modal as DefaultModal } from '../Modal';
6+
import type { ModalProps } from '../Modal';
7+
import { GlobalModal } from '../Modal';
78
import { useFetchReactions } from './hooks/useFetchReactions';
89
import { LoadingIndicator } from '../Loading';
910
import { Avatar } from '../Avatar';
11+
import type { MessageContextValue } from '../../context';
1012
import { useComponentContext, useMessageContext } from '../../context';
1113
import type { ReactionSort } from 'stream-chat';
12-
import type { ModalProps } from '../Modal';
13-
import type { MessageContextValue } from '../../context';
1414

1515
export type ReactionsListModalProps = ModalProps &
1616
Partial<Pick<MessageContextValue, 'handleFetchReactions' | 'reactionDetailsSort'>> & {
@@ -33,7 +33,7 @@ export function ReactionsListModal({
3333
sortReactionDetails: propSortReactionDetails,
3434
...modalProps
3535
}: ReactionsListModalProps) {
36-
const { Modal = DefaultModal } = useComponentContext();
36+
const { Modal = GlobalModal } = useComponentContext();
3737
const selectedReaction = reactions.find(
3838
({ reactionType }) => reactionType === selectedReactionType,
3939
);

0 commit comments

Comments
 (0)