-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* design: QA * refactor: font-yoon, font-noto 제거 * refactor: nvmrc 추가 * refactor: 메인 화면 제거 * refactor: NavbarContext 리팩터링 * refactor: SegmentNode의 children에서 null 제거 * refactor: MarginedMain 구현 * refactor: SessionContextProvider 제거 * feat: SessionContext 재구현 * fix: .internal 관련 빌드 에러 임시 수정 * feat: 주석 처리한 LoginVisible 주석 해제
- Loading branch information
Showing
118 changed files
with
615 additions
and
679 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 @@ | ||
v20.11.1 |
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,3 @@ | ||
{ | ||
"i18n-ally.localesPaths": ["messages"] | ||
} |
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,38 @@ | ||
'use server'; | ||
|
||
import { cookies } from 'next/headers'; | ||
|
||
import { UserState } from '@/contexts/SessionContext'; | ||
|
||
import { getRequest } from '@/apis/common/server'; | ||
|
||
import { COOKIE_SESSION_ID } from '@/constants/network'; | ||
|
||
export const getMockAuth = async () => { | ||
// TODO: getRequest 함수로 구현 | ||
// 지금은 /v1이 segment에 없어서 임시로 fetch를 사용해 직접 구현 | ||
const resp = await fetch(`https://cse-dev-waffle.bacchus.io/api/mock-login`, { | ||
method: 'GET', | ||
}); | ||
|
||
const cookie = resp.headers.getSetCookie()[0]; | ||
const value = cookie.split(/=|;/)[1]; | ||
|
||
cookies().set(COOKIE_SESSION_ID, value, { httpOnly: true, secure: true }); | ||
}; | ||
|
||
export const removeAuth = () => { | ||
cookies().delete(COOKIE_SESSION_ID); | ||
}; | ||
|
||
export const getIsStaff = async (): Promise<UserState> => { | ||
if (cookies().get(COOKIE_SESSION_ID) === undefined) return 'logout'; | ||
|
||
try { | ||
const resp = await getRequest<{ isStaff: boolean }>('/user/is-staff'); | ||
return resp.isStaff ? 'staff' : 'non-staff'; | ||
} catch { | ||
// removeAuth(); | ||
return 'logout'; | ||
} | ||
}; |
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,23 +1,9 @@ | ||
import { getMockAcademicsGuide, getMockCourseChanges, getMockCourses } from '@/data/academics'; | ||
|
||
import { Course, CourseChange, Guide } from '@/types/academics'; | ||
|
||
import { getRequest } from '.'; | ||
|
||
type StudentType = 'undergraduate' | 'graduate'; | ||
|
||
export const getAcademicsGuide = getMockAcademicsGuide; | ||
|
||
export const getCourses = getMockCourses; | ||
|
||
export const getEngCourses = getMockCourses; | ||
|
||
export const getCourseChanges = getMockCourseChanges; | ||
|
||
// export const getAcademicsGuide = (type: StudentType) => | ||
// getRequest(`/academics/${type}/guide`) as Promise<Guide>; | ||
|
||
// export const getCourses = (type: StudentType) => | ||
// getRequest(`/academics/${type}/courses`) as Promise<Course[]>; | ||
|
||
// export const getCourseChanges = (): Promise<CourseChange[]> => courseChangesData; |
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,9 +1,5 @@ | ||
import { getMockMainContents } from '@/data/main'; | ||
|
||
import { MainContents } from '@/types/main'; | ||
|
||
import { getRequest } from '.'; | ||
import { getRequest } from './common/client'; | ||
|
||
export const getMainContents = () => getRequest('') as Promise<MainContents>; | ||
|
||
// export const getMainContents = getMockMainContents; |
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,5 +1,17 @@ | ||
import RootLayout from '../[locale]/layout'; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return <RootLayout params={{ locale: 'ko' }}>{children}</RootLayout>; | ||
// TODO: 디자인 적용 | ||
export default async function RootLayout({ | ||
children, | ||
params, | ||
}: { | ||
children: React.ReactNode; | ||
params: { locale: string }; | ||
}) { | ||
return ( | ||
<html | ||
lang={params.locale} | ||
className="bg-neutral-900 font-normal text-neutral-800 sm:min-w-[1000px]" | ||
> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
} |
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,29 @@ | ||
'use client'; | ||
|
||
import { ReactNode } from 'react'; | ||
|
||
import { | ||
NAVBAR_CLOSED_WIDTH_REM, | ||
NAVBAR_EXPANDED_WIDTH_REM, | ||
} from '@/components/layout/navbar/NavbarRoot'; | ||
|
||
import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; | ||
import useResponsive from '@/utils/hooks/useResponsive'; | ||
import { main as mainNode } from '@/utils/segmentNode'; | ||
|
||
export default function MarginedMain({ children }: { children: ReactNode }) { | ||
const node = useCurrentSegmentNode(); | ||
const { screenType } = useResponsive(); | ||
|
||
let marginLeft = ''; | ||
if (screenType === 'desktop') { | ||
marginLeft = | ||
node === mainNode ? `${NAVBAR_EXPANDED_WIDTH_REM}rem` : `${NAVBAR_CLOSED_WIDTH_REM}rem`; | ||
} | ||
|
||
return ( | ||
<main className="flex h-full flex-col overflow-scroll" style={{ marginLeft }}> | ||
{children} | ||
</main> | ||
); | ||
} |
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,5 +1,5 @@ | ||
import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; | ||
|
||
export default async function AcademicsPage() { | ||
return <MajorCategoryPageLayout subtitle="Learning CSE" twoDimensional />; | ||
return <MajorCategoryPageLayout subtitle="Learning CSE" />; | ||
} |
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,5 +1,5 @@ | ||
import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; | ||
|
||
export default async function AdmissionsPage() { | ||
return <MajorCategoryPageLayout subtitle="Enroll CSE" twoDimensional />; | ||
return <MajorCategoryPageLayout subtitle="Enroll CSE" />; | ||
} |
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.