Skip to content

Commit

Permalink
UI: article JSON preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnestaP committed Nov 27, 2023
1 parent 9788082 commit df6e232
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["next","next/core-web-vitals"],
"extends": ["next/babel","next/core-web-vitals"],
"rules": {
"react/display-name": "off"
}
Expand Down
5 changes: 3 additions & 2 deletions ui/next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
experimental: {
largePageDataBytes: 256 * 100000,
},
}
};

module.exports = nextConfig
module.exports = nextConfig;
16 changes: 16 additions & 0 deletions ui/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import { SearchOutlined } from "@ant-design/icons";

const PageNotFound = () => {
return (
<div className="error-page">
<SearchOutlined />
<h1>
Page not found
</h1>
<p>The page you are looking for could not be found.</p>
</div>
);
};

export default PageNotFound;
22 changes: 22 additions & 0 deletions ui/src/pages/500.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { useRouter } from "next/router";
import { ExclamationCircleOutlined } from "@ant-design/icons";

const ServerErrorPage = () => {
const router = useRouter();

return (
<div className="error-page">
<ExclamationCircleOutlined />
<h1>Something went wrong</h1>
<p>
Please try again later or{" "}
<a type="button" onClick={() => router.push('/')}>
go to home page
</a>
</p>
</div>
);
};

export default ServerErrorPage;
17 changes: 17 additions & 0 deletions ui/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,20 @@ a {
#json-preview-card .ant-card-body {
padding: 0;
}

/* ERROR PAGES */

.error-page {
color: #777;
margin: 15% auto;
text-align: center;
}

.error-page .anticon {
font-size: 5rem;
margin-bottom: 1rem;
}

.error-page p {
font-size: 1.2rem;
}

0 comments on commit df6e232

Please sign in to comment.