From a4c4e91a2251d0c958fc9d8d09c07759da89712f Mon Sep 17 00:00:00 2001 From: six-standard Date: Mon, 26 Aug 2024 08:32:00 +0900 Subject: [PATCH] Bugs Fix --- packages/main/src/pages/Error.tsx | 6 ++++-- packages/main/src/pages/Pdf/LibraryView.tsx | 6 +++++- .../main/src/router/Layout/components/Modal.tsx | 4 +--- packages/main/src/router/Layout/index.tsx | 8 +++++--- packages/main/src/router/index.tsx | 13 +++++++++---- packages/teacher/src/page/Library/Button.tsx | 2 +- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/main/src/pages/Error.tsx b/packages/main/src/pages/Error.tsx index 1be369ad..bba53cd9 100644 --- a/packages/main/src/pages/Error.tsx +++ b/packages/main/src/pages/Error.tsx @@ -1,3 +1,4 @@ +import { Header } from "ui"; import { useParams } from "react-router-dom"; const string: { [key: string]: string } = { @@ -5,14 +6,15 @@ const string: { [key: string]: string } = { 401: "Unauthorized", 403: "Forbidden", 404: "Not found", - unsigned: "Unsigned Error", + unsigned: "Unsigned Error" }; export const Error = () => { const { code } = useParams(); return ( -
+
+
{code} {string[code || "unsigned"]} diff --git a/packages/main/src/pages/Pdf/LibraryView.tsx b/packages/main/src/pages/Pdf/LibraryView.tsx index e68e1931..4683803e 100644 --- a/packages/main/src/pages/Pdf/LibraryView.tsx +++ b/packages/main/src/pages/Pdf/LibraryView.tsx @@ -32,7 +32,11 @@ export const LibraryView = () => { ) : ( )} - + {page === max ? ( +
+ ) : ( + + )} {
- window.localStorage.replace( - `${process.env.VITE_APP_URL_STUDENT}/login` - ) + window.location.replace(`${process.env.VITE_APP_URL_TEACHER}/login`) } >
diff --git a/packages/main/src/router/Layout/index.tsx b/packages/main/src/router/Layout/index.tsx index a449a97a..fc65dffb 100644 --- a/packages/main/src/router/Layout/index.tsx +++ b/packages/main/src/router/Layout/index.tsx @@ -1,16 +1,18 @@ import { Header, Modal } from "./components"; -import { Outlet } from "react-router-dom"; import { useState } from "react"; export * from "./ViewLayout"; -export const Layout = () => { +interface IProp { + children: React.ReactElement | React.ReactElement[]; +} +export const Layout = ({ children }: IProp) => { const [opened, setOpened] = useState(false); return (
- + {children}
); }; diff --git a/packages/main/src/router/index.tsx b/packages/main/src/router/index.tsx index d4fd970d..2237a3cd 100644 --- a/packages/main/src/router/index.tsx +++ b/packages/main/src/router/index.tsx @@ -6,10 +6,14 @@ export const Router = () => { return ( - }> - } /> - } /> - + + <_.Landing /> + + } + /> } /> } /> @@ -18,6 +22,7 @@ export const Router = () => { } /> } /> + } /> } /> diff --git a/packages/teacher/src/page/Library/Button.tsx b/packages/teacher/src/page/Library/Button.tsx index a9ec705c..9fb17f7d 100644 --- a/packages/teacher/src/page/Library/Button.tsx +++ b/packages/teacher/src/page/Library/Button.tsx @@ -9,7 +9,7 @@ interface IProp { const navigate = (id: string) => window.location.replace( - `${process.env._VITE_APP_URL_MAIN}/library/${id}?prev=${window.location.href}` + `http://localhost:3000/viewer/library/${id}?prev=${window.location.href}` ); export const Button = ({ id, year, grade, generation }: IProp) => {