Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojude committed Jan 14, 2025
1 parent d7448c5 commit e80b873
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export function ErrorFeedback({ errorCode }: ErrorFeedbackProps) {
export const styles = css`
.error-feedback {
display: flex;
align-items: center;
gap: var(--size-gap);
white-space: nowrap;
}
.error-feedback-thanks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { styles as feedbackStyles } from './error-feedback/error-feedback'
import { noop as css } from '../../../helpers/noop-template'

export type ErrorOverlayFooterProps = {
errorCode: string
footerMessage?: string
errorCode: string | undefined
footerMessage: string | undefined
}

export function ErrorOverlayFooter({
Expand All @@ -13,17 +13,21 @@ export function ErrorOverlayFooter({
}: ErrorOverlayFooterProps) {
return (
<footer className="error-overlay-footer">
<p className="error-overlay-footer-message">{footerMessage}</p>
<ErrorFeedback errorCode={errorCode} />
{footerMessage ? (
<p className="error-overlay-footer-message">{footerMessage}</p>
) : null}
{errorCode ? <ErrorFeedback errorCode={errorCode} /> : null}
</footer>
)
}

export const styles = css`
.error-overlay-footer {
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
gap: var(--size-gap);
padding: var(--size-3);
background: var(--color-background-200);
border-top: 1px solid var(--color-gray-400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ export function ErrorOverlayLayout({
<ErrorOverlayDialogBody>{children}</ErrorOverlayDialogBody>

<DialogFooter>
{/* TODO: errorCode should not be undefined whatsoever */}
<ErrorOverlayFooter
footerMessage={footerMessage}
errorCode={errorCode!}
errorCode={errorCode}
/>
<ErrorOverlayBottomStacks
errorsCount={readyErrors?.length ?? 0}
Expand Down

0 comments on commit e80b873

Please sign in to comment.