-
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.
- Loading branch information
Showing
18 changed files
with
155 additions
and
103 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,7 @@ | ||
import BaseLayout from "~/components/base-layout"; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { children: React.ReactNode }) { | ||
return <BaseLayout>{children}</BaseLayout>; | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
20 changes: 3 additions & 17 deletions
20
apps/back-office/src/components/base-layout/hooks/use-layout-pathname.ts
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,31 +1,17 @@ | ||
"use client"; | ||
|
||
import { usePathname } from "next/navigation"; | ||
import { LayoutOption, LayoutRoute } from "../base-layout.type"; | ||
import { LayoutRoute } from "../base-layout.type"; | ||
|
||
const getBoolean = (value: boolean | undefined | null, defaultValue: boolean) => | ||
typeof value === "boolean" ? value : defaultValue; | ||
|
||
const useLayoutPathname = ( | ||
layoutRoutes: Array<LayoutRoute>, | ||
options: { | ||
layoutOptions: Array<LayoutOption>; | ||
defaultLayoutOption: Omit<LayoutOption, "pathname">; | ||
}, | ||
) => { | ||
const useLayoutPathname = (layoutRoutes: Array<LayoutRoute>) => { | ||
const pathname = usePathname(); | ||
const currentRoute = layoutRoutes.find((route) => | ||
pathname === "/" | ||
? route.pathname === pathname | ||
: route.pathname.startsWith(pathname), | ||
); | ||
const layoutOption = | ||
options.layoutOptions.find((layout) => layout.pathname === pathname) || | ||
options.defaultLayoutOption; | ||
const hasHeader = getBoolean(layoutOption.hasHeader, true); | ||
const hasSidebar = getBoolean(layoutOption.hasSidebar, true); | ||
|
||
return { currentRoute, hasHeader, hasSidebar }; | ||
return { currentRoute }; | ||
}; | ||
|
||
export default useLayoutPathname; |
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 |
---|---|---|
|
@@ -15,6 +15,14 @@ export default function RootLayout({ | |
}>) { | ||
return ( | ||
<html lang="ko"> | ||
<head> | ||
<link | ||
rel="stylesheet" | ||
as="style" | ||
crossOrigin="anonymous" | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.css" | ||
/> | ||
</head> | ||
<body {...stylex.props()}> | ||
<QueryProvider>{children}</QueryProvider> | ||
</body> | ||
|
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,3 @@ | ||
@import url('https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.min.css'); | ||
|
||
* { | ||
box-sizing: border-box; | ||
margin: 0; | ||
|
Oops, something went wrong.