-
Notifications
You must be signed in to change notification settings - Fork 0
관리자 공지사항 페이지, 컴포넌트 분리 (#issue 331) #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/components/admin/adminNotice/AdminNoticeList.styled.ts
This file contains hidden or 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,11 @@ | ||
| import styled from 'styled-components'; | ||
| import { SpinnerWrapperStyled } from '../../user/mypage/Spinner.styled'; | ||
|
|
||
| export const SpinnerWrapper = styled(SpinnerWrapperStyled)` | ||
| width: 100%; | ||
| `; | ||
|
|
||
| export const NoticeItemWrapper = styled.section` | ||
| display: flex; | ||
| justify-content: center; | ||
| `; | ||
12 changes: 6 additions & 6 deletions
12
...otice/adminNoticeList/AdminNoticeList.tsx → ...nts/admin/adminNotice/AdminNoticeList.tsx
This file contains hidden or 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 hidden or 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
14 changes: 7 additions & 7 deletions
14
...ice/adminNoticeWrite/AdminNoticeWrite.tsx → ...ts/admin/adminNotice/AdminNoticeWrite.tsx
This file contains hidden or 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.
8 changes: 4 additions & 4 deletions
8
src/components/admin/searchBar/SearchBar.tsx → ...ents/common/admin/searchBar/SearchBar.tsx
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
...s/admin/adminNotice/AdminNotice.styled.ts → src/pages/admin/CommonAdminPage.styled.ts
This file contains hidden or 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 hidden or 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,16 @@ | ||
| import { Outlet } from 'react-router-dom'; | ||
| import AdminTitle from '../../components/common/admin/title/AdminTitle'; | ||
| import * as S from './CommonAdminPage.styled'; | ||
|
|
||
| interface CommonAdminPageProps { | ||
| title: string; | ||
| } | ||
|
|
||
| export default function CommonAdminPage({ title }: CommonAdminPageProps) { | ||
| return ( | ||
| <S.AdminNoticeContainer> | ||
| <AdminTitle title={title} /> | ||
| <Outlet /> | ||
| </S.AdminNoticeContainer> | ||
| ); | ||
| } |
File renamed without changes.
Empty file.
This file contains hidden or 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,12 +1,5 @@ | ||
| import { Outlet } from 'react-router-dom'; | ||
| import AdminTitle from '../../../components/common/admin/title/AdminTitle'; | ||
| import * as S from './AdminNotice.styled'; | ||
| import CommonAdminPage from '../commonAdminPage'; | ||
|
|
||
| export default function AdminNotice() { | ||
| return ( | ||
| <S.AdminNoticeContainer> | ||
| <AdminTitle title='공지사항' /> | ||
| <Outlet /> | ||
| </S.AdminNoticeContainer> | ||
| ); | ||
| return <CommonAdminPage title='공지사항' />; | ||
| } |
9 changes: 0 additions & 9 deletions
9
src/pages/admin/adminNotice/adminNoticeList/AdminNoticeList.styled.ts
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/pages/admin/adminNotice/adminNoticeList/AdminNoticeListPage.tsx
This file contains hidden or 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,5 @@ | ||
| import AdminNoticeList from '../../../../components/admin/adminNotice/AdminNoticeList'; | ||
|
|
||
| export default function AdminNoticeListPage() { | ||
| return <AdminNoticeList />; | ||
| } |
5 changes: 5 additions & 0 deletions
5
src/pages/admin/adminNotice/adminNoticeWrite/AdminNoticeWritePage.tsx
This file contains hidden or 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,5 @@ | ||
| import AdminNoticeWrite from '../../../../components/admin/adminNotice/AdminNoticeWrite'; | ||
|
|
||
| export default function AdminNoticeWritePage() { | ||
| return <AdminNoticeWrite />; | ||
| } |
This file contains hidden or 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,8 @@ | ||
| import NoticeDetailBundle from '../../../components/user/customerService/noticeDetail/NoticeDetailBundle'; | ||
| import useAuthStore from '../../../store/authStore'; | ||
|
|
||
| export default function AdminNoticeDetail() { | ||
| return <NoticeDetailBundle $width='90%' />; | ||
| const isAdmin = useAuthStore((state) => state.userData?.admin) ?? false; | ||
|
|
||
| return <NoticeDetailBundle $width='90%' $isAdmin={isAdmin} />; | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
NoticeItemWrapper 중복 코드를 정리해주세요.
이 컴포넌트는
src/pages/admin/CommonAdminPage.styled.ts의NoticeItemWrapper와 동일한 스타일을 가지고 있습니다.코드 중복을 방지하기 위해 공통 컴포넌트를 사용하거나 하나의 위치로 통합하는 것을 고려해주세요.
그리고 대신 공통 스타일 파일에서 임포트하여 사용하세요:
+import { NoticeItemWrapper } from '../../pages/admin/CommonAdminPage.styled';🤖 Prompt for AI Agents