-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
655a0b8
commit 912074f
Showing
11 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from 'theme-ui'; | ||
import { ControlTypes } from '@component-controls/core'; | ||
import { AppError, AppErrorProps } from './AppError'; | ||
|
||
export default { | ||
title: 'Application/AppError', | ||
component: AppError, | ||
}; | ||
|
||
export const overview = ({ error }: AppErrorProps) => ( | ||
<AppError error={error} /> | ||
); | ||
|
||
overview.controls = { | ||
error: { | ||
type: ControlTypes.TEXT, | ||
rows: 4, | ||
value: `some error | ||
text | ||
`, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** @jsx jsx */ | ||
import { FC } from 'react'; | ||
import { jsx, Box } from 'theme-ui'; | ||
|
||
export interface AppErrorProps { | ||
/** | ||
* Error text, "apperror" theme key. | ||
*/ | ||
error?: string; | ||
} | ||
/** | ||
* application build-time error container | ||
*/ | ||
export const AppError: FC<AppErrorProps> = ({ error }) => { | ||
return error ? ( | ||
<Box | ||
variant="apperror" | ||
dangerouslySetInnerHTML={{ | ||
__html: error.split('\n').join('<br />'), | ||
}} | ||
/> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './AppError'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters