-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #706 from davidktlee/fix-notification
fix: 알림 요청 api url 수정
- Loading branch information
Showing
3 changed files
with
30 additions
and
5 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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import type { ReactNode } from 'react'; | ||
import '../globals.css'; | ||
import Header from '../_components/header/Header'; | ||
import NextPublicProvider from '@/context/NextPublicContext'; | ||
|
||
export default async function WithHeaderLayout({ | ||
children, | ||
}: { | ||
children: ReactNode; | ||
}) { | ||
const { DEV_BASE_URL, BASE_URL, ENVIRONMENT } = process.env; | ||
const currentBaseUrl = ENVIRONMENT === 'production' ? BASE_URL : DEV_BASE_URL; | ||
return ( | ||
<section className="w-full h-full flex flex-col"> | ||
<Header /> | ||
{children} | ||
</section> | ||
<NextPublicProvider nextBaseUrl={currentBaseUrl}> | ||
<section className="w-full h-full flex flex-col"> | ||
<Header /> | ||
{children} | ||
</section> | ||
</NextPublicProvider> | ||
); | ||
} |
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,18 @@ | ||
'use client'; | ||
import { ReactElement, createContext } from 'react'; | ||
|
||
export const NextPublicContext = createContext<string>(''); | ||
|
||
export default function NextPublicProvider({ | ||
children, | ||
nextBaseUrl, | ||
}: { | ||
children: ReactElement; | ||
nextBaseUrl: string; | ||
}) { | ||
return ( | ||
<NextPublicContext.Provider value={nextBaseUrl}> | ||
{children} | ||
</NextPublicContext.Provider> | ||
); | ||
} |