-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dependencies and import paths
- Loading branch information
Showing
117 changed files
with
876 additions
and
4,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
FROM node:18-buster as runner | ||
# Install pnpm | ||
|
||
RUN npm install -g pnpm | ||
# setup container data structure | ||
RUN mkdir -p /home/obscuro/go-obscuro/tools/tenscan/ | ||
COPY ./tools/tenscan/frontend /home/obscuro/go-obscuro/tools/tenscan/frontend | ||
|
||
WORKDIR /home/obscuro/go-obscuro/tools/tenscan/frontend | ||
COPY . /home/obscuro/go-obscuro/ | ||
|
||
WORKDIR /home/obscuro/go-obscuro/ | ||
|
||
RUN pnpm install | ||
|
||
EXPOSE 80 | ||
WORKDIR /home/obscuro/go-obscuro/tools/tenscan/frontend | ||
|
||
RUN pnpm install --filter ./tools/tenscan/frontend... | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["pnpm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,7 @@ | ||
import { ErrorType } from "@/src/types/interfaces"; | ||
import Error from "./_error"; | ||
import Custom404Error from "@repo/ui/components/common/404"; | ||
|
||
export function Custom404Error({ | ||
customPageTitle, | ||
showRedirectText, | ||
redirectText, | ||
isFullWidth, | ||
message, | ||
showMessage = true, | ||
redirectLink, | ||
children, | ||
}: ErrorType) { | ||
return ( | ||
<Error | ||
heading={` ${customPageTitle || "Oops! Page"} Not Found`} | ||
statusText={`We can't seem to find the ${ | ||
customPageTitle || "page" | ||
} you're looking for.`} | ||
statusCode={404} | ||
showRedirectText={showRedirectText} | ||
redirectText={redirectText || "Home Page"} | ||
message={ | ||
message || | ||
`The ${ | ||
customPageTitle || "page" | ||
} you are looking for might have been removed, had its name changed, or is temporarily unavailable.` | ||
} | ||
isFullWidth={isFullWidth} | ||
showMessage={showMessage} | ||
redirectLink={redirectLink} | ||
> | ||
{children} | ||
</Error> | ||
); | ||
} | ||
const Custom404 = () => { | ||
return <Custom404Error />; | ||
}; | ||
|
||
export default Custom404Error; | ||
export default Custom404; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
import { ErrorType } from "@/src/types/interfaces"; | ||
import Error from "./_error"; | ||
import Custom500Error from "@repo/ui/components/common/500"; | ||
|
||
function Custom500Error({ | ||
customPageTitle, | ||
message, | ||
showRedirectText, | ||
redirectText, | ||
err, | ||
redirectLink, | ||
children, | ||
}: ErrorType) { | ||
return ( | ||
<Error | ||
heading={"Oops! Something went wrong."} | ||
message={ | ||
message || | ||
"We're experiencing technical difficulties. Please try again later." | ||
} | ||
statusText={customPageTitle || `An Error occured`} | ||
statusCode={500} | ||
showRedirectText={showRedirectText || true} | ||
redirectText={redirectText || "Home Page"} | ||
err={err} | ||
redirectLink={redirectLink} | ||
> | ||
{children} | ||
</Error> | ||
); | ||
} | ||
const Custom404 = () => { | ||
return <Custom500Error />; | ||
}; | ||
|
||
export default Custom500Error; | ||
export default Custom404; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,27 @@ | ||
import CustomError from "@repo/ui/components/common/error"; | ||
import React from "react"; | ||
import NextErrorComponent from "next/error"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import { ErrorType } from "@/src/types/interfaces"; | ||
|
||
function ErrorMessage({ | ||
statusText, | ||
message, | ||
showMessage, | ||
showStatusText, | ||
}: any) { | ||
export default function CustomErrorPage({ statusCode, err }: any) { | ||
return ( | ||
<div className="error-message"> | ||
{showStatusText && <h3>{statusText}</h3>} | ||
{message && showMessage && ( | ||
<p className="text-muted-foreground">{message}</p> | ||
)} | ||
</div> | ||
<CustomError | ||
statusCode={statusCode} | ||
err={err} | ||
heading={ | ||
statusCode === 404 ? "Page Not Found" : "Oops! Something went wrong." | ||
} | ||
message={ | ||
statusCode === 404 | ||
? "Sorry, the page you're looking for doesn't exist." | ||
: "We're experiencing technical difficulties. Please try again later." | ||
} | ||
redirectLink="/" | ||
redirectText="Back to Home" | ||
/> | ||
); | ||
} | ||
|
||
export function CustomError({ | ||
showRedirectText = true, | ||
heading = "Oops! Something went wrong.", | ||
statusText = "500", | ||
message = "We're experiencing technical difficulties. Please try again later.", | ||
redirectText = "Home Page", | ||
isFullWidth, | ||
err, | ||
showMessage = true, | ||
showStatusText, | ||
statusCode, | ||
isModal, | ||
redirectLink = "/", | ||
children, | ||
...props | ||
}: ErrorType) { | ||
return ( | ||
<section | ||
className="h-full flex flex-col justify-center items-center" | ||
{...props} | ||
> | ||
<main className={isFullWidth ? "max-w-full" : ""}> | ||
<div className="text-center"> | ||
<h1 className="text-4xl font-extrabold mb-6">{heading}</h1> | ||
<div className={isFullWidth ? "w-full" : ""}> | ||
<ErrorMessage | ||
showStatusText={showStatusText} | ||
showMessage={showMessage} | ||
message={message} | ||
statusText={statusText} | ||
/> | ||
</div> | ||
{showRedirectText && ( | ||
<div> | ||
Go to{" "} | ||
<Link | ||
href={redirectLink} | ||
passHref | ||
className="text-primary pointer underline" | ||
> | ||
{redirectText} | ||
</Link>{" "} | ||
{/* <div> | ||
Looks like you're on the wrong side of town, buddy. | ||
Let's get you back on the <Link href="/">right side</Link>. | ||
</div> */} | ||
</div> | ||
)} | ||
{children} | ||
</div> | ||
</main> | ||
</section> | ||
); | ||
} | ||
|
||
CustomError.getInitialProps = async ({ res, err }: any) => { | ||
// custom server-side props | ||
CustomErrorPage.getInitialProps = async ({ res, err }: any) => { | ||
const statusCode = res ? res.statusCode : err?.statusCode || 404; | ||
const errorInitialProps = await NextErrorComponent.getInitialProps({ | ||
res, | ||
err, | ||
} as any); | ||
errorInitialProps.statusCode = statusCode; | ||
|
||
return statusCode < 500 | ||
? errorInitialProps | ||
: { ...errorInitialProps, statusCode }; | ||
return { statusCode, err }; | ||
}; | ||
|
||
export default CustomError; |
Oops, something went wrong.