-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9a5265
commit 284e39b
Showing
18 changed files
with
6,986 additions
and
6,745 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NEXT_PUBLIC_BASE_URL=http://localhost:8000 | ||
NEXT_PUBLIC_CLIENT_ID= |
Large diffs are not rendered by default.
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,30 @@ | ||
import Typography from "@mui/material/Typography"; | ||
import type { Metadata } from "next"; | ||
// eslint-disable-next-line no-restricted-imports | ||
import Link from "next/link"; | ||
|
||
import MainLayoutContainer from "@/components/containers/MainLayoutContainer"; | ||
import { getServerTranslation } from "@/services/i18n"; | ||
|
||
type Props = { | ||
params: { language: string }; | ||
}; | ||
|
||
export async function generateMetadata({ params }: Props): Promise<Metadata> { | ||
const { t } = await getServerTranslation(params.language, "common"); | ||
|
||
return { | ||
title: t("videos"), | ||
}; | ||
} | ||
|
||
export default function Videos() { | ||
return ( | ||
<MainLayoutContainer> | ||
<Typography variant="h3" color="primary" width="100%"> | ||
Videos | ||
</Typography> | ||
<Link href="/videos/asdf">Video Detail</Link> | ||
</MainLayoutContainer> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useEffect } from "react"; | ||
|
||
import { useRouter, usePathname } from "next/navigation"; | ||
import { useSelector } from "react-redux"; | ||
|
||
import { selectAccessToken } from "@/redux/login/selectors"; | ||
import useLanguage from "@/services/i18n/use-language"; | ||
|
||
const useAuth = () => { | ||
const language = useLanguage(); | ||
const router = useRouter(); | ||
const pathname = usePathname(); | ||
const token = useSelector(selectAccessToken); | ||
|
||
useEffect(() => { | ||
const isRootOrLoginPage = pathname === `/${language}` || pathname === `/${language}/login`; | ||
|
||
if (token && isRootOrLoginPage) { | ||
router.push(`/${language}/videos`); | ||
} else if (!token) { | ||
router.push(`/${language}/login`); | ||
} | ||
}, [router, language, token, pathname]); | ||
}; | ||
|
||
export default useAuth; |
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
Oops, something went wrong.