diff --git a/components/common/Error/index.tsx b/components/common/Error/index.tsx deleted file mode 100644 index 62a0b9b..0000000 --- a/components/common/Error/index.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import Image from 'next/image'; -import { useRouter } from 'next/router'; -import errorImage from 'public/img/error.png'; -import Layout from '../Layout'; - -function Error() { - const router = useRouter(); - - return ( - -
-
- error -
-
- Sorry, something went wrong -
-
- An unexpected error has occurred. If reloading the page does not fix - it, please contact Rango support. -
- -
-
- ); -} - -export default Error; diff --git a/components/common/Layout/Layout.type.ts b/components/common/Layout/Layout.type.ts deleted file mode 100644 index 94e3ef1..0000000 --- a/components/common/Layout/Layout.type.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface LayoutProps { - title: string; - hasSearchInput?: boolean; -} diff --git a/components/common/Layout/index.tsx b/components/common/Layout/index.tsx deleted file mode 100644 index 9899983..0000000 --- a/components/common/Layout/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import Head from 'next/head'; -import { PropsWithChildren } from 'react'; -import Navbar from '../Navbar'; -import { LayoutProps } from './Layout.type'; -import Footer from '../Footer'; - -function Layout(props: PropsWithChildren) { - return ( -
- - {props.title} - - -
- {props.children} -
- -
-
- ); -} - -export default Layout; diff --git a/components/common/Loading.tsx b/components/common/Loading.tsx deleted file mode 100644 index c02e2ae..0000000 --- a/components/common/Loading.tsx +++ /dev/null @@ -1,34 +0,0 @@ -const Loading: React.FC = () => ( - - - - - - - -); -export default Loading; diff --git a/components/common/RefreshButton/index.tsx b/components/common/RefreshButton/index.tsx deleted file mode 100644 index 6145f0d..0000000 --- a/components/common/RefreshButton/index.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import React, { useEffect, useState } from 'react'; - -import RefreshProgressButton from './RefreshProgressButton'; -import { RefreshButtonProps } from './RefreshButton.type'; - -const REFRESH_INTERVAL = 1000; -const MAX_PERCENTAGE = 100; - -export default function RefreshButton(props: RefreshButtonProps) { - const { onClick, refreshTime } = props; - const [elapsedTime, setElapsedTime] = useState(0); - const [isRefetch, setIsRefetch] = useState(false); - - const handleVisibilityChange = (interval?: number) => { - if (document.hidden && interval) { - clearTimeout(interval); - } - }; - - useEffect(() => { - let interval: number | undefined; - if (onClick) { - interval = window.setInterval(() => { - setElapsedTime((prevTime) => prevTime + 1); - - if (elapsedTime === refreshTime) { - handleRefreshClick(); - } - }, REFRESH_INTERVAL); - } else { - clearTimeout(interval); - } - - document.addEventListener('visibilitychange', () => - handleVisibilityChange(interval), - ); - - return () => { - document.removeEventListener('visibilitychange', () => - handleVisibilityChange(interval), - ); - if (interval) { - clearInterval(interval); - } - }; - }, [elapsedTime, onClick]); - - const clearTimeout = (interval?: number) => { - if (interval) { - clearInterval(interval); - } - setElapsedTime(0); - }; - - const handleRefreshClick = () => { - if (onClick) onClick(); - setElapsedTime(0); - setIsRefetch(true); - }; - - return ( - - ); -} diff --git a/components/common/Table/TableBody.tsx b/components/common/Table/TableBody.tsx deleted file mode 100644 index 5db12e5..0000000 --- a/components/common/Table/TableBody.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ -import { TableBodyProps } from './Table.type'; -import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import { columns } from './Table.helper'; -import Link from 'next/link'; - -dayjs.extend(utc); - -function TableBody(props: TableBodyProps) { - const { data } = props; - return ( -
- {data.map((item) => { - const { requestId } = item; - return ( -
- {columns.map((col) => { - const CellComponent = col.component; - return CellComponent ? ( - - ) : null; - })} - - - Detail - -
- ); - })} -
- ); -} - -export default TableBody; diff --git a/components/search/Result/Result.type.ts b/components/search/Result/Result.type.ts deleted file mode 100644 index 561529b..0000000 --- a/components/search/Result/Result.type.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SwapType } from 'types'; - -export interface PropsType { - data: SwapType[]; - query: string; - total: number; - page: number; -} diff --git a/next.config.js b/next.config.js index 3d3bc99..70259b0 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,7 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - reactStrictMode: true, - swcMinify: true, -}; - -module.exports = nextConfig; +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + swcMinify: true, +}; + +module.exports = nextConfig; diff --git a/package.json b/package.json index f3d082c..b56e9a1 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "eslint --fix --quiet .", + "lint": "next lint", "prettier": "prettier --write", "prepare": "husky install", "build:icons": "svgr svgs/resources/ --config-file svgs/configs/.svgrrc.default.cjs && prettier -w ./components/icons" @@ -15,6 +15,7 @@ "@artsy/fresnel": "^7.1.3", "@lingui/react": "^4.11.4", "@rango-dev/charts": "^0.2.1-next.5", + "@next/third-parties": "^14.2.15", "@react-spring/web": "^9.5.5", "@svgr/babel-plugin-remove-jsx-attribute": "^8.0.0", "@svgr/cli": "^8.1.0", @@ -24,15 +25,12 @@ "chart.js": "4.2.1", "chartjs-chart-sankey": "^0.12.1", "dayjs": "^1.11.6", - "eslint-config-next": "^13.0.4", "is-mobile": "^3.1.1", - "next": "^13.0.4", - "nextjs-progressbar": "^0.0.16", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-toastify": "^9.1.1", - "sass": "^1.57.0", - "swr": "^1.3.0" + "next": "^14.2.11", + "nextjs-toploader": "^3.7.15", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "sass": "^1.57.0" }, "devDependencies": { "@next/eslint-plugin-next": "^13.0.7", diff --git a/pages/404.tsx b/pages/404.tsx deleted file mode 100644 index 901dab7..0000000 --- a/pages/404.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import Layout from 'components/common/Layout'; -import Image from 'next/image'; -import Link from 'next/link'; -import pageNotFoundImage from 'public/img/404.png'; - -function NotFoundPage() { - return ( - -
-
- 404 -
-
- Page Not Found -
-
- Sorry, we couldn’t find that page. -
- - Back To Home - -
-
- ); -} - -export default NotFoundPage; diff --git a/pages/_app.tsx b/pages/_app.tsx deleted file mode 100644 index 6804da8..0000000 --- a/pages/_app.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import '../styles/globals.css'; -import type { AppProps } from 'next/app'; -import NextNProgress from 'nextjs-progressbar'; -import { ReactNode } from 'react'; -import 'react-toastify/dist/ReactToastify.css'; -import { ToastContainer } from 'react-toastify'; - -export default function App({ Component, pageProps }: AppProps): ReactNode { - return ( - <> - - - - - - ); -} diff --git a/pages/_document.tsx b/pages/_document.tsx deleted file mode 100644 index 044cd66..0000000 --- a/pages/_document.tsx +++ /dev/null @@ -1,82 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -import Document, { - Html, - Head, - Main, - NextScript, - DocumentContext, -} from 'next/document'; -import Script from 'next/script'; - -const description = 'Track all transactions on Rango Exchange'; -const socialTitle = 'Rango Exchange Explorer'; -const BASE_URL = 'https://explorer.rango.exchange'; -const APP_NAME = 'Rango Exchange Explorer'; - -class MyDocument extends Document { - static async getInitialProps(ctx: DocumentContext) { - const initialProps = await Document.getInitialProps(ctx); - return { ...initialProps }; - } - - render() { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - -