Skip to content

Commit

Permalink
decouple
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Jan 10, 2025
1 parent e8ff3e0 commit d0813da
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,4 @@ export function ErrorOverlayDialogBody({
)
}

export const styles = css`
.error-overlay-dialog {
background: var(--color-background-100);
border: 1px solid var(--color-gray-400);
border-radius: var(--rounded-xl);
box-shadow: var(--shadow-md);
}
`
export const DIALOG_BODY_STYLES = css``
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ErrorOverlayDialog({
)
}

export const styles = css`
export const DIALOG_STYLES = css`
.error-overlay-dialog {
background: var(--color-background-100);
border: 1px solid var(--color-gray-400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function ErrorOverlayDialogHeader({
)
}

export const styles = css`
export const DIALOG_HEADER_STYLES = css`
.nextjs-container-errors-header {
position: relative;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { VersionInfo } from '../../../../../../../../server/dev/parse-versi
import type { ErrorMessageType } from '../error-message/error-message'
import type { ErrorType } from '../error-type-label/error-type-label'

import { DialogBody, DialogContent, DialogFooter } from '../../Dialog'
import { DialogContent, DialogFooter } from '../../Dialog'
import { Overlay } from '../../Overlay'
import {
ErrorOverlayToolbar,
Expand All @@ -25,11 +25,13 @@ import {
ErrorOverlayFloatingHeader,
styles as floatingHeaderStyles,
} from '../error-overlay-floating-header/error-overlay-floating-header'
import { ErrorOverlayDialog, styles as dialogStyles } from '../dialog/dialog'

import { ErrorOverlayDialog, DIALOG_STYLES } from '../dialog/dialog'
import {
ErrorOverlayDialogHeader,
styles as dialogHeaderStyles,
} from '../dialog/dialog-header'
DIALOG_HEADER_STYLES,
} from '../dialog/header'
import { ErrorOverlayDialogBody, DIALOG_BODY_STYLES } from '../dialog/body'

type ErrorOverlayLayoutProps = {
errorMessage: ErrorMessageType
Expand Down Expand Up @@ -85,9 +87,9 @@ export function ErrorOverlayLayout({
</div>
<ErrorMessage errorMessage={errorMessage} />
</ErrorOverlayDialogHeader>
<DialogBody className="nextjs-container-errors-body">
{children}
</DialogBody>

<ErrorOverlayDialogBody>{children}</ErrorOverlayDialogBody>

<DialogFooter>
{/* TODO: errorCode should not be undefined whatsoever */}
<ErrorOverlayFooter
Expand All @@ -106,8 +108,10 @@ export function ErrorOverlayLayout({
}

export const styles = css`
${dialogStyles}
${dialogHeaderStyles}
${DIALOG_STYLES}
${DIALOG_HEADER_STYLES}
${DIALOG_BODY_STYLES}
${floatingHeaderStyles}
${errorTypeLabelStyles}
${errorMessageStyles}
Expand Down

0 comments on commit d0813da

Please sign in to comment.