mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 23:08:54 +02:00
polish(core): better styling for error screens (#8736)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
e21591c073
commit
7961c5b8d5
7 changed files with 52 additions and 12 deletions
|
@ -96,4 +96,7 @@ export {
|
|||
UnlistedMetadata,
|
||||
} from './utils/unlistedUtils';
|
||||
|
||||
export {ErrorBoundaryTryAgainButton} from './utils/errorBoundaryUtils';
|
||||
export {
|
||||
ErrorBoundaryTryAgainButton,
|
||||
ErrorBoundaryError,
|
||||
} from './utils/errorBoundaryUtils';
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.errorBoundaryError {
|
||||
white-space: pre-wrap;
|
||||
color: red;
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import React, {type ComponentProps} from 'react';
|
||||
import Translate from '@docusaurus/Translate';
|
||||
import styles from './errorBoundaryUtils.module.css';
|
||||
|
||||
export function ErrorBoundaryTryAgainButton(
|
||||
props: ComponentProps<'button'>,
|
||||
|
@ -21,3 +22,7 @@ export function ErrorBoundaryTryAgainButton(
|
|||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
export function ErrorBoundaryError({error}: {error: Error}): JSX.Element {
|
||||
return <p className={styles.errorBoundaryError}>{error.message}</p>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue