mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
added styled error page
This commit is contained in:
27
scm-ui/src/components/ErrorPage.js
Normal file
27
scm-ui/src/components/ErrorPage.js
Normal file
@@ -0,0 +1,27 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import ErrorNotification from "./ErrorNotification";
|
||||
|
||||
type Props = {
|
||||
error: Error,
|
||||
title: string,
|
||||
subtitle: string
|
||||
};
|
||||
|
||||
class ErrorPage extends React.Component<Props> {
|
||||
render() {
|
||||
const { title, subtitle, error } = this.props;
|
||||
|
||||
return (
|
||||
<section className="section">
|
||||
<div className="box column is-4 is-offset-4 container">
|
||||
<h1 className="title">{title}</h1>
|
||||
<p className="subtitle">{subtitle}</p>
|
||||
<ErrorNotification error={error} />
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ErrorPage;
|
||||
@@ -12,6 +12,7 @@ import Header from "../components/Header";
|
||||
import PrimaryNavigation from "../components/PrimaryNavigation";
|
||||
import Loading from "../components/Loading";
|
||||
import ErrorNotification from "../components/ErrorNotification";
|
||||
import ErrorPage from "../components/ErrorPage";
|
||||
|
||||
type Props = {
|
||||
me: any,
|
||||
@@ -40,7 +41,13 @@ class App extends Component<Props> {
|
||||
content = <Loading />;
|
||||
} else if (error) {
|
||||
// TODO add error page instead of plain notification
|
||||
content = <ErrorNotification error={error} />;
|
||||
content = (
|
||||
<ErrorPage
|
||||
title="Error"
|
||||
subtitle="Unknown error occurred"
|
||||
error={error}
|
||||
/>
|
||||
);
|
||||
} else if (!me) {
|
||||
content = <Login />;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user