Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed story replies modal and calling pip interactions
- Loading branch information
1 parent
0aa9351
commit bf4e697
Showing
8 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2022 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { ModalContainerContext } from './ModalHost'; | ||
|
||
type Props = { | ||
children: ReactNode; | ||
className?: string; | ||
}; | ||
|
||
/** | ||
* Provide a div directly under the document.body that Modals can use as a DOM parent. | ||
* | ||
* Useful when you want to control the stacking context of all children, by customizing | ||
* the styles of the container in way that also applies to modals. | ||
*/ | ||
export const ModalContainer = ({ children, className }: Props): JSX.Element => { | ||
const containerRef = React.useRef<HTMLDivElement | null>(null); | ||
return ReactDOM.createPortal( | ||
<div ref={containerRef} className={className}> | ||
<ModalContainerContext.Provider value={containerRef.current}> | ||
{children} | ||
</ModalContainerContext.Provider> | ||
</div>, | ||
document.body | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters