diff --git a/.github/workflows/main-deploy.yml b/.github/workflows/main-deploy.yml index 7b6452000..4e5685cb6 100644 --- a/.github/workflows/main-deploy.yml +++ b/.github/workflows/main-deploy.yml @@ -20,6 +20,7 @@ jobs: - name: Build env: NEXT_PUBLIC_SERVER_ENDPOINT: ${{ secrets.NEXT_PUBLIC_SERVER_ENDPOINT }} + NEXT_PUBLIC_AGENDA_SERVER_ENDPOINT: ${{ secrets.NEXT_PUBLIC_AGENDA_SERVER_ENDPOINT }} NEXT_PUBLIC_CLIENT_ENDPOINT: ${{ secrets.NEXT_PUBLIC_CLIENT_ENDPOINT }} NEXT_PUBLIC_MANAGE_SERVER_ENDPOINT: ${{ secrets.NEXT_PUBLIC_MANAGE_SERVER_ENDPOINT }} NEXT_PUBLIC_PARTY_MANAGE_SERVER_ENDPOINT: ${{ secrets.NEXT_PUBLIC_PARTY_MANAGE_SERVER_ENDPOINT }} diff --git a/Layout/TakguLayout.tsx b/Layout/TakguLayout.tsx index bd9d5c344..ea2c1a20c 100644 --- a/Layout/TakguLayout.tsx +++ b/Layout/TakguLayout.tsx @@ -1,7 +1,6 @@ +import { useRouter } from 'next/router'; import { useRecoilValue } from 'recoil'; import { openCurrentMatchState } from 'utils/recoil/takgu/match'; -import AdminReject from 'components/admin/AdminReject'; -import AdminLayout from 'components/admin/Layout'; import CurrentMatch from 'components/takgu/Layout/CurrentMatch'; import Footer from 'components/takgu/Layout/Footer'; import Header from 'components/takgu/Layout/Header'; @@ -16,7 +15,6 @@ import useGetUserSeason from 'hooks/takgu/Layout/useGetUserSeason'; import useLiveCheck from 'hooks/takgu/Layout/useLiveCheck'; import useSetAfterGameModal from 'hooks/takgu/Layout/useSetAfterGameModal'; import { useUser } from 'hooks/takgu/Layout/useUser'; -import useAxiosResponse from 'hooks/useAxiosResponse'; import styles from 'styles/takgu/Layout/Layout.module.scss'; import PlayButton from '../components/takgu/Layout/PlayButton'; import UserLayout from '../components/takgu/Layout/UserLayout'; @@ -27,12 +25,12 @@ type TakguLayoutProps = { children: React.ReactNode; }; -function TakguLayout({ children }: TakguLayoutProps) { +const TakguLayout = ({ children }: TakguLayoutProps) => { const user = useUser(); const presentPath = usePathname(); + const path = useRouter().pathname; const openCurrentMatch = useRecoilValue(openCurrentMatchState); - // useAxiosResponse(); useGetUserSeason(presentPath); useSetAfterGameModal(); useLiveCheck(presentPath); @@ -40,22 +38,20 @@ function TakguLayout({ children }: TakguLayoutProps) { if (!user || !user.intraId) return null; - switch (true) { - case presentPath.includes('takgu/admin'): - if (!user.isAdmin) return ; - return {children}; - - case presentPath.includes('takgu/recruit'): + const renderContent = () => { + if (path.includes('takgu/recruit')) { return {children}; + } - case presentPath === 'takgu/statistics' && user.isAdmin: + if (path.includes('takgu/statistics') && user.isAdmin) { return ( ); + } - case presentPath.includes('takgu'): + if (presentPath.includes('takgu')) { return ( <> @@ -71,12 +67,15 @@ function TakguLayout({ children }: TakguLayoutProps) { {children}