-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create layout component & copy images
- Loading branch information
Showing
26 changed files
with
106 additions
and
70 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ const nextConfig: NextConfig = { | |
images: { | ||
unoptimized: true, | ||
}, | ||
basePath: "/v2", | ||
}; | ||
|
||
export default nextConfig; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ReactNode, useEffect } from "react"; | ||
import { useSession } from "@/hooks/use-session"; | ||
|
||
export const AuthedPageLayout = (props: { children: ReactNode }) => { | ||
const session = useSession(); | ||
|
||
useEffect(() => { | ||
if (session.isLoading) { | ||
return; | ||
} | ||
if (!session.user) { | ||
window.location.pathname = "/login"; | ||
} | ||
}, [session.isLoading, session.user]); | ||
|
||
return session.isLoading ? null : props.children; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { cn } from "@/util/cn"; | ||
import { ReactNode } from "react"; | ||
|
||
const contentWrapperClass = { | ||
sm: "lg:max-w-screen-sm", | ||
md: "lg:max-w-screen-md", | ||
lg: "lg:max-w-screen-lg", | ||
xl: "lg:max-w-screen-xl", | ||
"2xl": "lg:max-w-screen-2xl", | ||
}; | ||
|
||
export const ContentWrapper = (props: { | ||
size: keyof typeof contentWrapperClass; | ||
children: ReactNode; | ||
}) => { | ||
return ( | ||
<div | ||
className={cn( | ||
"bg-white w-full rounded-md py-6 px-10 shadow-2xl backdrop-blur-md bg-opacity-95 lg:mt-6 lg:mx-auto", | ||
contentWrapperClass[props.size] | ||
)} | ||
> | ||
{props.children} | ||
</div> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import ky from "ky"; | ||
import { z } from "zod"; | ||
|
||
const StaticResourcesHashResp = z.object({ | ||
hash: z.string(), | ||
}); | ||
|
||
// This is only used for Vue components and should eventually be removed. | ||
export const useStaticResourceHash = () => { | ||
const { data: staticResourceHash } = useQuery({ | ||
queryKey: ["static_resources_hash"], | ||
queryFn: async () => { | ||
const resp = await ky.get("/static_resources_hash").json(); | ||
return StaticResourcesHashResp.parse(resp); | ||
}, | ||
}); | ||
|
||
return staticResourceHash?.hash; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AuthedPageLayout } from "@/components/AuthedPageLayout"; | ||
import { ContentWrapper } from "@/components/ContentWrapper"; | ||
import { VueNavbar } from "@/components/VueNavbar"; | ||
|
||
export default function TestPage() { | ||
return ( | ||
<AuthedPageLayout> | ||
<VueNavbar pageName="TestPage" /> | ||
<ContentWrapper size="sm">Hello from React!</ContentWrapper> | ||
</AuthedPageLayout> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import clsx, { ClassValue } from "clsx"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
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