diff --git a/website/.eslintrc.json b/website/.eslintrc.json index bffb357..265d318 100644 --- a/website/.eslintrc.json +++ b/website/.eslintrc.json @@ -1,3 +1,18 @@ { - "extends": "next/core-web-vitals" + "extends": [ + "eslint:recommended", + "next/core-web-vitals" + ], + "rules": { + "semi": [ + "warn", + "never" + ], + "no-unused-vars": [ + "warn" + ], + "no-unused-expressions": [ + "warn" + ] + } } diff --git a/website/components/header.tsx b/website/components/header.tsx index 76fa1a9..a4636e2 100644 --- a/website/components/header.tsx +++ b/website/components/header.tsx @@ -1,8 +1,7 @@ -import { faM, faMoon, faSun } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { RocketLaunch } from "@mui/icons-material"; -import { AppBar, IconButton, Link, Stack, Toolbar, Typography } from "@mui/material"; -import { useState } from "react"; +import { faMoon, faSun } from "@fortawesome/free-solid-svg-icons" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import { RocketLaunch } from "@mui/icons-material" +import { AppBar, IconButton, Link, Stack, Toolbar, Typography } from "@mui/material" export default function Footer({ toggleTheme, theme}: Props) { return ( diff --git a/website/pages/404.tsx b/website/pages/404.tsx index 4e48ffd..4890134 100644 --- a/website/pages/404.tsx +++ b/website/pages/404.tsx @@ -1,9 +1,6 @@ import { Button } from '@mui/material' import Head from 'next/head' -import { useCookies } from 'react-cookie' import styled from 'styled-components' -import { links } from '../config' -import ThemeInterface from '../types/theme' const Title = styled.h1` margin: 0; @@ -48,7 +45,7 @@ export default function NotFound() { - 404 | This page could not be found. + 404 | Server-side error occurred diff --git a/website/pages/500.tsx b/website/pages/500.tsx new file mode 100644 index 0000000..a5ef996 --- /dev/null +++ b/website/pages/500.tsx @@ -0,0 +1,56 @@ +import { Button } from '@mui/material' +import Head from 'next/head' +import styled from 'styled-components' + +const Title = styled.h1` + margin: 0; + line-height: 1.15; + font-size: 1.5rem; + text-align: center; + + a { + color: ${({ theme }) => theme.pages.index.title.a}; + text-decoration: none; + animation: animate 1.5s linear infinite; + } + + @keyframes animate { + 0% { + opacity: 0; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0; + } + } + + a:hover, + a:focus, + a:active { + text-decoration: underline; + } +` + +const StyledButton = styled(Button)` + margin-top: 1rem; +` + +export default function NotFound() { + return ( + <> + + 404 - HomeDisk + + + + 404 | This page could not be found + + + + Go to Home Page + + + ) +} diff --git a/website/pages/_app.tsx b/website/pages/_app.tsx index 94f5d68..4d1b103 100644 --- a/website/pages/_app.tsx +++ b/website/pages/_app.tsx @@ -1,4 +1,4 @@ -import { Button, ThemeProvider as MuiThemeProvider, createTheme as muiCreateTheme, PaletteMode } from '@mui/material' +import { ThemeProvider as MuiThemeProvider, createTheme as muiCreateTheme, PaletteMode } from '@mui/material' import { useEffect, useState } from 'react' import { useCookies } from 'react-cookie' import { createGlobalStyle, ThemeProvider } from 'styled-components' diff --git a/website/pages/index.tsx b/website/pages/index.tsx index a0f4ccf..a1cb095 100644 --- a/website/pages/index.tsx +++ b/website/pages/index.tsx @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react' import { useCookies } from 'react-cookie' import styled from 'styled-components' import { links } from '../config' -import ThemeInterface from '../types/theme' const Title = styled.h1` margin: 0; diff --git a/website/pages/login.tsx b/website/pages/login.tsx index 355bca9..e32166b 100644 --- a/website/pages/login.tsx +++ b/website/pages/login.tsx @@ -1,3 +1,4 @@ +import React from 'react' import { Button, TextField } from '@mui/material' import Head from 'next/head' import Router from 'next/router' diff --git a/website/pages/user/files.tsx b/website/pages/user/files.tsx index 07efe60..0700005 100644 --- a/website/pages/user/files.tsx +++ b/website/pages/user/files.tsx @@ -131,5 +131,6 @@ type Props = { path: string, size: string, modified: string, - refresh: (path: string) => any + // eslint-disable-next-line no-unused-vars + refresh: (path: string) => void } diff --git a/website/tsconfig.json b/website/tsconfig.json index 2af619b..e31ee5d 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -15,6 +15,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "pages/404.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }