-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from YerangPark/dev
fix: API URL 버그 수정
- Loading branch information
Showing
23 changed files
with
1,958 additions
and
131 deletions.
There are no files selected for viewing
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,15 @@ | ||
'use client' | ||
|
||
import PortfolioViewPage from '@/components/templates/PortfolioViewPage' | ||
import { useParams } from 'next/navigation' | ||
|
||
export default function Page() { | ||
const params = useParams() | ||
if (Array.isArray(params.id) || !params.id || Array.isArray(params.username) || !params.username) { | ||
return <div>올바르지 않은 접근입니다.</div> | ||
} | ||
const { username } = params | ||
const id = parseInt(params.id, 10) | ||
|
||
return <PortfolioViewPage username={username} id={id} isPublic /> | ||
} |
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,20 @@ | ||
'use client' | ||
|
||
import DashboardPage from '@/components/templates/DashboardPage' | ||
import isTokenExpired from '@/utils/TokenExpiredChecker' | ||
import { useRouter } from 'next/navigation' | ||
import { useEffect } from 'react' | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
|
||
useEffect(() => { | ||
const token = localStorage.getItem('token') | ||
if (!token || isTokenExpired(token)) { | ||
localStorage.removeItem('token') | ||
router.push('/') | ||
} | ||
}, [router]) | ||
|
||
return <DashboardPage /> | ||
} |
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,20 @@ | ||
'use client' | ||
|
||
import GuestbookPage from '@/components/templates/GuestbookPage' | ||
import isTokenExpired from '@/utils/TokenExpiredChecker' | ||
import { useRouter } from 'next/navigation' | ||
import { useEffect } from 'react' | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
|
||
useEffect(() => { | ||
const token = localStorage.getItem('token') | ||
if (!token || isTokenExpired(token)) { | ||
localStorage.removeItem('token') | ||
router.push('/') | ||
} | ||
}, [router]) | ||
|
||
return <GuestbookPage /> | ||
} |
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,20 @@ | ||
'use client' | ||
|
||
import PortfolioFormPage from '@/components/templates/PortfolioFormPage' | ||
import isTokenExpired from '@/utils/TokenExpiredChecker' | ||
import { useRouter } from 'next/navigation' | ||
import { useEffect } from 'react' | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
|
||
useEffect(() => { | ||
const token = localStorage.getItem('token') | ||
if (!token || isTokenExpired(token)) { | ||
localStorage.removeItem('token') | ||
router.push('/') | ||
} | ||
}, [router]) | ||
|
||
return <PortfolioFormPage /> | ||
} |
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
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,57 @@ | ||
import React, { useState, useEffect } from 'react' | ||
import ReactMarkdown from 'react-markdown' | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import rehypeRaw from 'rehype-raw' | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import remarkGfm from 'remark-gfm' | ||
import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalCloseButton } from '@chakra-ui/react' | ||
|
||
interface MarkdownModalProps { | ||
isOpen: boolean | ||
onClose: () => void | ||
mdFilePath: string // .md 파일의 경로 | ||
} | ||
|
||
const fetchMarkdownContent = async (mdFilePath: string): Promise<string> => { | ||
try { | ||
const response = await fetch(mdFilePath) | ||
const content = await response.text() | ||
return content | ||
} catch (error) { | ||
console.error('Markdown 파일을 불러오는 중 오류 발생:', error) | ||
return '' | ||
} | ||
} | ||
|
||
const MarkdownModal: React.FC<MarkdownModalProps> = ({ isOpen, onClose, mdFilePath }) => { | ||
const [markdownContent, setMarkdownContent] = useState<string>('') | ||
|
||
console.log(`mdFilePath : ${mdFilePath}`) | ||
// .md 파일 읽어오기 | ||
useEffect(() => { | ||
if (isOpen && mdFilePath) { | ||
fetchMarkdownContent(mdFilePath).then((content) => { | ||
setMarkdownContent(content) | ||
}) | ||
} | ||
}, [isOpen, mdFilePath]) | ||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose} size="xl"> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>Markdown 내용 보기</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<div className="markdown"> | ||
<ReactMarkdown rehypePlugins={[rehypeRaw]} remarkPlugins={[remarkGfm]}> | ||
{markdownContent} | ||
</ReactMarkdown> | ||
</div> | ||
</ModalBody> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default MarkdownModal |
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
Oops, something went wrong.