Skip to content

Commit

Permalink
decouple
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Jan 14, 2025
1 parent 83850be commit 716bd0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { ErrorMessageType } from '../error-message/error-message'
import type { ErrorType } from '../error-type-label/error-type-label'

import { DialogContent, DialogFooter } from '../../Dialog'
import { Overlay } from '../../Overlay'
import {
ErrorOverlayToolbar,
styles as toolbarStyles,
Expand Down Expand Up @@ -33,6 +32,7 @@ import {
} from '../dialog/header'
import { ErrorOverlayDialogBody, DIALOG_BODY_STYLES } from '../dialog/body'
import { CALL_STACK_STYLES } from '../call-stack/call-stack'
import { OVERLAY_STYLES, ErrorOverlayOverlay } from '../overlay/overlay'

type ErrorOverlayLayoutProps = {
errorMessage: ErrorMessageType
Expand Down Expand Up @@ -69,7 +69,7 @@ export function ErrorOverlayLayout({
isTurbopack,
}: ErrorOverlayLayoutProps) {
return (
<Overlay fixed={isBuildError}>
<ErrorOverlayOverlay fixed={isBuildError}>
<ErrorOverlayDialog onClose={onClose} isTurbopack={isTurbopack}>
<DialogContent>
<ErrorOverlayFloatingHeader
Expand Down Expand Up @@ -107,11 +107,12 @@ export function ErrorOverlayLayout({
</DialogFooter>
</DialogContent>
</ErrorOverlayDialog>
</Overlay>
</ErrorOverlayOverlay>
)
}

export const styles = css`
${OVERLAY_STYLES}
${DIALOG_STYLES}
${DIALOG_HEADER_STYLES}
${DIALOG_BODY_STYLES}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { noop as css } from '../../../helpers/noop-template'
import { Overlay, type OverlayProps } from '../../Overlay/Overlay'

export function ErrorOverlayOverlay({ children, ...props }: OverlayProps) {
return <Overlay {...props}>{children}</Overlay>
}

export const OVERLAY_STYLES = css`
[data-nextjs-dialog-overlay] {
top: var(--size-8_5);
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { noop as css } from '../../helpers/noop-template'
const styles = css`
[data-nextjs-dialog-overlay] {
position: fixed;
top: var(--size-8_5);
top: 0;
right: 0;
bottom: 0;
left: 0;
Expand Down

0 comments on commit 716bd0e

Please sign in to comment.