diff options
| author | Haishan <[email protected]> | 2019-05-14 00:30:36 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2019-05-14 23:31:11 +0800 |
| commit | 16e61f15333b2724cf754124de926e1597ce5bde (patch) | |
| tree | 684757445710f6a48f2ce898b0f7d6502267542a /src/components/ErrorBoundaryFallback.js | |
| parent | 882b168082ddbcbe7991a71a09944f1a60084fc3 (diff) | |
feat(logs): fetch logs with correct log level
see also #14
Diffstat (limited to 'src/components/ErrorBoundaryFallback.js')
| -rw-r--r-- | src/components/ErrorBoundaryFallback.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/components/ErrorBoundaryFallback.js b/src/components/ErrorBoundaryFallback.js index 5d5698a..211985a 100644 --- a/src/components/ErrorBoundaryFallback.js +++ b/src/components/ErrorBoundaryFallback.js @@ -1,22 +1,22 @@ import React from 'react'; -import Icon from 'c/Icon'; +import PropTypes from 'prop-types'; import SvgYacd from './SvgYacd'; -import github from 's/github.svg'; +import SvgGithub from './SvgGithub'; import s0 from './ErrorBoundaryFallback.module.css'; const yacdRepoIssueUrl = 'https://github.com/haishanh/yacd/issues'; -function ErrorBoundaryFallback() { +function ErrorBoundaryFallback({ message, detail }) { return ( <div className={s0.root}> <div className={s0.yacd}> <SvgYacd width={150} height={150} /> </div> - <h1>Oops, something went wrong!</h1> + {message ? <h1>{message}</h1> : null} + {detail ? <p>{detail}</p> : null} <p> - If you think this is a bug, reporting this at{' '} <a className={s0.link} href={yacdRepoIssueUrl}> - <Icon id={github.id} width={16} height={16} /> + <SvgGithub width={16} height={16} /> haishanh/yacd </a> </p> @@ -24,4 +24,8 @@ function ErrorBoundaryFallback() { ); } +ErrorBoundaryFallback.propTypes = { + message: PropTypes.string +}; + export default ErrorBoundaryFallback; |
