This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(preview): pattern error handling (fixes #271)
- Loading branch information
1 parent
bcfe1b9
commit 9fdad0b
Showing
3 changed files
with
87 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
|
||
export interface ErrorMessageProps { | ||
error: string; | ||
patternName: string; | ||
} | ||
|
||
export const ErrorMessage: React.StatelessComponent<ErrorMessageProps> = props => ( | ||
<div | ||
style={{ | ||
'background-color': 'rgb(240, 40, 110)', | ||
color: 'white', | ||
padding: '12px 15px', | ||
'text-align': 'center' | ||
}} | ||
> | ||
<p | ||
style={{ | ||
margin: '0', | ||
'font-family': | ||
'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"', | ||
'font-size': '15px', | ||
'line-height': '22px' | ||
}} | ||
> | ||
{props.patternName} failed to render: {props.error} | ||
</p> | ||
</div> | ||
); |
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