-
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
1 parent
b050d50
commit 602e4f6
Showing
6 changed files
with
381 additions
and
0 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
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,19 @@ | ||
import { axiosInstance } from '../utils/apiConfig'; | ||
|
||
interface NoticeListResDto { | ||
id?: string; | ||
version?: string; | ||
title?: string; | ||
content?: string; | ||
createdAt?: string; | ||
} | ||
|
||
export const getNotice = async (): Promise<NoticeListResDto[] | null> => { | ||
try { | ||
const response = await axiosInstance.get(`/admin/notices`, {}); | ||
return response.data.data.noticeListResDto; | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
return null; | ||
} | ||
}; |
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,167 @@ | ||
import { Helmet } from 'react-helmet-async'; | ||
import Flex from '../../components/Flex'; | ||
import Navbar from '../../components/Navbar'; | ||
import * as S from './NoticePageStyled'; | ||
import leftarrow from '../../img/leftarrow.png'; | ||
import Friend from '../../components/Friend/Friend'; | ||
import Pagination from '../../components/CustomPagination'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { useState } from 'react'; | ||
import { useSearchFriendsList } from '../../hooks/useFollowersList'; | ||
import { useDebounce } from '../../hooks/useDebounce'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { getNotice } from '../../api/NoticeApi'; | ||
import { BlockNoteView } from '@blocknote/mantine'; | ||
import { useCreateBlockNote } from '@blocknote/react'; | ||
|
||
const NoticePage = () => { | ||
const navigate = useNavigate(); | ||
const editor = useCreateBlockNote(); | ||
|
||
const { data } = useQuery({ | ||
queryKey: ['notices'], | ||
queryFn: getNotice, | ||
}); | ||
|
||
console.log(data); | ||
|
||
const renderEditor = async (content: string) => { | ||
const blocks = await editor.tryParseMarkdownToBlocks(content); | ||
editor.replaceBlocks(editor.document, blocks); | ||
|
||
return ( | ||
// <S.StyledEditorWrapper> | ||
<BlockNoteView editor={editor} editable={false} theme="light" /> | ||
// </S.StyledEditorWrapper> | ||
); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Helmet> | ||
<title>끄적끄적 | 공지사항</title> | ||
</Helmet> | ||
<S.MainDashBoardLayout> | ||
<Navbar /> | ||
<S.MainDashBoardContainer> | ||
<S.NoticeModal> | ||
<S.Header> | ||
{/* <img src={leftarrow} onClick={() => navigate(-1)} /> */} | ||
<S.Title>공지사항</S.Title> | ||
</S.Header> | ||
|
||
<S.NoticeContainer> | ||
{data?.map((item, index) => ( | ||
<details key={item.id || index}> | ||
<summary> | ||
<p className="version">{item.version}</p> | ||
<p className="title">{item.title}</p> | ||
<p className="date">{item.createdAt}</p> | ||
</summary> | ||
{item.content} | ||
</details> | ||
))} | ||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 | ||
내용을 작성합니다. 여기에 자세한 내용을 작성합니다. 여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
|
||
<details> | ||
<summary> | ||
<p className="version">[v1.3.2]</p> | ||
<p className="title">제목</p> | ||
<p className="date">2024.12.12</p> | ||
</summary> | ||
여기에 자세한 내용을 작성합니다. | ||
</details> | ||
</S.NoticeContainer> | ||
|
||
<S.ContactContainer> | ||
<p>Copyright © KKEUJEOK. All rights reserved.</p> | ||
<p>[email protected]</p> | ||
</S.ContactContainer> | ||
</S.NoticeModal> | ||
</S.MainDashBoardContainer> | ||
</S.MainDashBoardLayout> | ||
</> | ||
); | ||
}; | ||
|
||
export default NoticePage; |
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,138 @@ | ||
import { styled } from 'styled-components'; | ||
import theme from '../../styles/Theme/Theme'; | ||
import rightArrowImg from '../../img/rightarrow.png'; | ||
|
||
export const MainDashBoardLayout = styled.div` | ||
width: 100vw; | ||
min-width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
`; | ||
|
||
export const MainDashBoardContainer = styled.section` | ||
width: 100%; | ||
height: 100vh; | ||
padding: 4.3125rem 2.5rem; | ||
overflow: hidden; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
hr { | ||
border: 1px solid #f4f4f4; | ||
} | ||
`; | ||
|
||
export const NoticeModal = styled.div` | ||
width: 50vw; | ||
height: fit-content; | ||
max-height: 80vh; | ||
padding: 3.5rem 3rem; | ||
/* padding-top: 40vh; */ | ||
border-radius: 1rem; | ||
border: 1px solid ${theme.color.stroke2}; | ||
box-shadow: ${theme.boxShadow.default}; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
overflow: auto; | ||
`; | ||
|
||
export const Header = styled.div` | ||
width: 100%; | ||
padding-bottom: 13px; | ||
border-bottom: 1px solid #f4f4f4; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
img { | ||
width: 1.5rem; | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
export const Title = styled.p` | ||
font-size: 1.5rem; | ||
font-weight: ${theme.font.weight.bold}; | ||
margin-right: 13px; | ||
`; | ||
|
||
export const NoticeContainer = styled.div` | ||
margin-top: 1rem; | ||
width: 100%; | ||
p { | ||
display: inline-block; | ||
} | ||
.version { | ||
font-weight: ${theme.font.weight.bold}; | ||
width: 10%; | ||
margin-left: 0.3rem; | ||
} | ||
.title { | ||
width: calc(100% - 10% - 15% - 6%); | ||
} | ||
.date { | ||
width: 15%; | ||
text-align: right; | ||
color: ${theme.color.gray}; | ||
} | ||
details { | ||
/* margin-top: 1rem 0; */ | ||
margin: 1rem 0; | ||
} | ||
details:last-child { | ||
margin-bottom: 1rem; | ||
} | ||
summary { | ||
margin-bottom: 1rem; | ||
cursor: pointer; | ||
list-style: none; /* 기본 아이콘 제거 */ | ||
} | ||
summary::-webkit-details-marker { | ||
display: none; /* 크롬/사파리 등의 브라우저에서 기본 아이콘 숨기기 */ | ||
} | ||
summary::before { | ||
content: ''; | ||
display: inline-block; | ||
width: 1rem; | ||
height: 1rem; | ||
margin-right: 0.5rem; | ||
background-image: url(${rightArrowImg}); | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
transition: transform 0.3s ease; | ||
} | ||
details[open] summary::before { | ||
transform: rotate(90deg); /* 열리면 아이콘 회전 */ | ||
} | ||
`; | ||
|
||
export const StyledEditorWrapper = styled.div``; | ||
|
||
export const ContactContainer = styled.div` | ||
width: 100%; | ||
border-top: 1px solid #f4f4f4; | ||
padding-top: 0.5rem; | ||
p { | ||
color: ${theme.color.gray}; | ||
margin-top: 0.5rem; | ||
font-size: 0.8rem; | ||
} | ||
`; |
Oops, something went wrong.