You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filepizza/legacy/ErrorPage.tsx

38 lines
799 B
TypeScript

import React from 'react'
import ErrorStore from '../stores/ErrorStore'
import Spinner from './Spinner'
export default class ErrorPage extends React.Component {
constructor() {
super()
this.state = ErrorStore.getState()
this._onChange = () => {
this.setState(ErrorStore.getState())
}
}
componentDidMount() {
ErrorStore.listen(this._onChange)
}
componentWillUnmount() {
ErrorStore.unlisten(this._onChange)
}
render() {
return (
<div className="page">
<Spinner dir="up" />
<h1 className="with-subtitle">FilePizza</h1>
<p className="subtitle">
<strong>{this.state.status}:</strong> {this.state.message}
</p>
{this.state.stack ? <pre>{this.state.stack}</pre> : null}
</div>
)
}
}