Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(v2): better error message style #1454

Merged
merged 1 commit into from
May 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions packages/docusaurus/src/client/theme-fallback/Loading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,39 @@

import React from 'react';

export default props => {
if (props.error) {
console.warn(props.error);
return <div align="center">Error</div>;
export default ({error, retry, pastDelay}) => {
if (error) {
return (
<div
style={{
align: 'center',
color: '#fff',
backgroundColor: '#fa383e',
borderColor: '#fa383e',
borderStyle: 'solid',
borderRadius: '0.25rem',
borderWidth: '1px',
boxSizing: 'border-box',
display: 'block',
padding: '1rem',
flex: '0 0 50%',
marginLeft: '25%',
marginRight: '25%',
marginTop: '5rem',
maxWidth: '50%',
width: '100%',
}}>
<p>{error.message}</p>
<div>
<button type="button" onClick={retry}>
Retry
</button>
</div>
</div>
);
}

if (props.pastDelay) {
if (pastDelay) {
return (
<div
style={{
Expand Down