Skip to content

Commit

Permalink
fix: bootstrap styles are not available in the overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
alsakhaev committed Jul 18, 2024
1 parent 1245cde commit 0d4818a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/engine/src/custom-elements/dapplet-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createPortal } from 'react-dom'
import styled from 'styled-components'
import { useViewport } from '../app/contexts/viewport-context'
import { ShadowDomWrapper } from '../app/components/shadow-dom-wrapper'
import { useMutableWeb } from '../app/contexts/mutable-web-context'

const ModalBackdrop = styled.div`
background: #ffffff88;
Expand All @@ -25,12 +26,13 @@ export interface OverlayProps {
}

export const Overlay: React.FC<OverlayProps> = ({ children }) => {
const { engine } = useMutableWeb()
const { viewportRef } = useViewport()

if (!viewportRef.current) return null

return createPortal(
<ShadowDomWrapper className="mweb-overlay">
<ShadowDomWrapper className="mweb-overlay" stylesheetSrc={engine.config.bosElementStyleSrc}>
<ModalBackdrop>{children}</ModalBackdrop>
</ShadowDomWrapper>,
viewportRef.current
Expand Down

0 comments on commit 0d4818a

Please sign in to comment.