From 83f3b3680fb5b868677f364f6956d5711d2cb4e3 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Mon, 2 Sep 2024 23:30:10 +0900 Subject: [PATCH 01/17] =?UTF-8?q?Fix:=20=EB=AA=A8=EB=8B=AC=20=EB=B0=8F=20b?= =?UTF-8?q?ackdrop=20z-index=20=EC=A1=B0=EC=A0=95,=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?container=20=EC=99=BC=EC=AA=BD=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/agenda/Form/Form.module.scss | 1 + styles/agenda/modal/AgendaModalProvider.module.scss | 2 +- styles/agenda/modal/modal.module.scss | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/styles/agenda/Form/Form.module.scss b/styles/agenda/Form/Form.module.scss index 5ce426afa..01de79aaa 100644 --- a/styles/agenda/Form/Form.module.scss +++ b/styles/agenda/Form/Form.module.scss @@ -4,6 +4,7 @@ display: flex; width: 100%; flex-direction: column; + text-align: left; } .pageContianer { diff --git a/styles/agenda/modal/AgendaModalProvider.module.scss b/styles/agenda/modal/AgendaModalProvider.module.scss index 0d0622261..5026f9cf6 100644 --- a/styles/agenda/modal/AgendaModalProvider.module.scss +++ b/styles/agenda/modal/AgendaModalProvider.module.scss @@ -3,7 +3,7 @@ .backdrop { @include backdrop; position: fixed; - z-index: 4000; + z-index: 4; display: flex; justify-content: center; diff --git a/styles/agenda/modal/modal.module.scss b/styles/agenda/modal/modal.module.scss index c757a86be..93550280f 100644 --- a/styles/agenda/modal/modal.module.scss +++ b/styles/agenda/modal/modal.module.scss @@ -2,13 +2,14 @@ .modalContainer { @include container(modal); - z-index: 5000; + z-index: 5; display: flex; width: max-content; min-width: 20rem; height: max-content; flex-direction: column; + overflow: visible; line-height: 150%; text-align: center; white-space: pre; @@ -32,6 +33,7 @@ &.left { width: 100%; padding: 0 1rem; + text-align: left; } } From f95c8482a14d1551484bd82e48c02e0361d8e9d8 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 00:29:42 +0900 Subject: [PATCH 02/17] =?UTF-8?q?Fix:=20axios=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC,=20=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=97=86=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EB=B0=8F=20=EC=82=B4=EC=A7=9D=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../announcements/AnnouncementTable.tsx | 225 ++++++++---------- 1 file changed, 100 insertions(+), 125 deletions(-) diff --git a/components/admin/agenda/announcements/AnnouncementTable.tsx b/components/admin/agenda/announcements/AnnouncementTable.tsx index 774009db8..ad966b987 100644 --- a/components/admin/agenda/announcements/AnnouncementTable.tsx +++ b/components/admin/agenda/announcements/AnnouncementTable.tsx @@ -1,10 +1,10 @@ import { useRouter } from 'next/router'; import { useCallback, useEffect, useState } from 'react'; -import { Description } from '@mui/icons-material'; import { MenuItem, Paper, Select, + SelectChangeEvent, Table, TableBody, TableCell, @@ -47,11 +47,6 @@ export interface IAnnouncementTable { currentPage: number; } -export interface Request { - page: number; - size: number; -} - export default function AnnouncementTable() { const router = useRouter(); const { agendaKey } = router.query; @@ -62,39 +57,26 @@ export default function AnnouncementTable() { totalPage: 1, currentPage: 1, }); - const [currentPage, setCurrentPage] = useState(1); - const [selectedAgendaKey, setSelectedAgendaKey] = useState(''); - const agendaList = useFetchGet(`list`).data || []; + const [selectedAgendaKey, setSelectedAgendaKey] = useState(''); + const agendaList = useFetchGet('admin/list').data || []; - const buttonList: string[] = [styles.coin, styles.penalty]; + useEffect(() => { + if (agendaKey) { + setSelectedAgendaKey(agendaKey as string); + } + }, [agendaKey]); - const handleButtonAction = (buttonName: string, announce: IAnnouncement) => { - switch (buttonName) { - case '수정': - openModal({ - type: 'modify', - title: '공지사항 수정', - description: '변경 후 수정 버튼을 눌러주세요.', - FormComponent: AnnouncementForm, - data: announce, - stringKey: agendaKey as string, - isAdmin: true, - onProceed: () => { - closeModal(); - getAnnoucementList(); - }, - }); + useEffect(() => { + if (selectedAgendaKey) { + fetchAnnouncementList(); } - }; + }, [selectedAgendaKey, currentPage]); - const getAnnoucementList = useCallback(async () => { - try { - if (!selectedAgendaKey) { - return; - } // 선택된 agenda가 없으면 반환 + const fetchAnnouncementList = useCallback(async () => { + if (!selectedAgendaKey) return; - // const res = mockTeamList; // 여기에 API 호출 추가 + try { const response = await instance.get(`/agenda/admin/announcement`, { params: { agenda_key: selectedAgendaKey, @@ -105,44 +87,44 @@ export default function AnnouncementTable() { setAnnouncementInfo({ announcementList: response.data.content.map( - (announce: IAnnouncement) => { - return { - ...announce, - createdAt: dateToString(new Date(announce.createdAt)), - }; - } + (announce: IAnnouncement) => ({ + ...announce, + createdAt: dateToString(new Date(announce.createdAt)), + }) ), totalPage: Math.ceil(response.data.totalSize / itemsPerPage), - currentPage: currentPage, + currentPage, }); - } catch (e) { - console.error('Error fetching team list:', e); + } catch (error) { + console.error('Error fetching announcement list:', error); } - }, [currentPage, selectedAgendaKey]); // selectedAgendaKey 추가 + }, [currentPage, selectedAgendaKey]); - useEffect(() => { - if (agendaKey) { - setSelectedAgendaKey(agendaKey as string); - } - }, [agendaKey]); - - useEffect(() => { - if (selectedAgendaKey) { - getAnnoucementList(); - } - }, [selectedAgendaKey, currentPage, getAnnoucementList]); - - const handleSelectChange = (event: { target: { value: any } }) => { - const newValue = event.target.value; + const handleSelectChange = (event: SelectChangeEvent) => { + const newValue = event.target.value as string; setSelectedAgendaKey(newValue); - setCurrentPage(1); // 페이지 초기화 + setCurrentPage(1); router.push(`?agendaKey=${newValue}`); }; - const renderIsShow = (isShow: boolean) => { - return isShow ? '공개' : '비공개'; + const handleButtonAction = (announce: IAnnouncement) => { + openModal({ + type: 'modify', + title: '공지사항 수정', + description: '변경 후 수정 버튼을 눌러주세요.', + FormComponent: AnnouncementForm, + data: announce, + stringKey: agendaKey as string, + isAdmin: true, + onProceed: () => { + closeModal(); + fetchAnnouncementList(); + }, + }); }; + const renderIsShow = (isShow: boolean) => (isShow ? '공개' : '비공개'); + return (
@@ -164,75 +146,68 @@ export default function AnnouncementTable() {
{selectedAgendaKey ? ( - - - - - {announcementInfo.announcementList.length > 0 ? ( - announcementInfo.announcementList.map( - (announce: IAnnouncement, index) => ( - - {agendaTableFormat['announcement'].columns.map( - (columnName: string, index: number) => { - return ( - - {columnName === 'isShow' - ? renderIsShow(announce[columnName]) - : columnName !== 'etc' - ? announce[columnName as keyof IAnnouncement] // 다른 열의 기본 값 표시 - : agendaTableFormat[ - 'announcement' - ].etc?.value.map( - (buttonName: string, index: number) => ( - - ) - )} - - ); - } - )} - + <> + +
+ + + {announcementInfo.announcementList && + announcementInfo.announcementList.length > 0 ? ( + announcementInfo.announcementList.map( + (announce: IAnnouncement, index) => ( + + {agendaTableFormat['announcement'].columns.map( + (columnName: string, index: number) => { + return ( + + {columnName === 'isShow' ? ( + renderIsShow(announce[columnName]) + ) : columnName !== 'etc' ? ( + announce[columnName as keyof IAnnouncement] // 다른 열의 기본 값 표시 + ) : ( + + )} + + ); + } + )} + + ) ) - ) - ) : ( - - )} - -
-
+ ) : ( + + )} + + + +
+ { + setCurrentPage(pageNumber); + fetchAnnouncementList(); + }} + /> +
+ ) : (
아젠다를 선택해주세요.
)} -
- { - setCurrentPage(pageNumber); - getAnnoucementList(); - }} - /> -
); } From a74a66809c98508bc69f409d916a2fa1fba0e882 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 00:54:02 +0900 Subject: [PATCH 03/17] =?UTF-8?q?Feat:=20admin=20agenda=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=8B=9C=20=ED=8F=AC=EC=8A=A4=ED=84=B0=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/agenda/agendaList/AgendaTable.tsx | 15 ++++++++++++++- components/agenda/modal/NoticeModal.tsx | 15 ++++++++++++++- constants/admin/agendaTable.ts | 2 +- types/agenda/modalTypes.ts | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/components/admin/agenda/agendaList/AgendaTable.tsx b/components/admin/agenda/agendaList/AgendaTable.tsx index ab3c06cbd..b05168347 100644 --- a/components/admin/agenda/agendaList/AgendaTable.tsx +++ b/components/admin/agenda/agendaList/AgendaTable.tsx @@ -88,8 +88,9 @@ export default function AgendaTable({ status, isOfficial }: AgendaTableProps) { const { openModal, closeModal } = useModal(); const buttonList: string[] = [ - styles.detail, styles.delete, + styles.default, + styles.detail, styles.coin, styles.penalty, ]; @@ -156,6 +157,18 @@ export default function AgendaTable({ status, isOfficial }: AgendaTableProps) { case '공지사항': router.push(`/admin/agenda/announcements?agendaKey=${agendaKey}`); break; + case '포스터': + if (!agenda.agendaPosterUrl) { + alert('포스터가 없습니다.'); + return; + } + openModal({ + type: 'notice', + title: '포스터', + description: "포스터 수정은 '자세히' 버튼을 눌러주세요.", + image: agenda.agendaPosterUrl, + }); + break; } }; diff --git a/components/agenda/modal/NoticeModal.tsx b/components/agenda/modal/NoticeModal.tsx index d236b9c10..fd76f52c9 100644 --- a/components/agenda/modal/NoticeModal.tsx +++ b/components/agenda/modal/NoticeModal.tsx @@ -1,9 +1,10 @@ +import Image from 'next/image'; import { agendaModal } from 'types/agenda/modalTypes'; import { useModal } from 'components/agenda/modal/useModal'; import styles from 'styles/agenda/modal/modal.module.scss'; const NoticeModal = (props: agendaModal) => { - const { title, description, onProceed } = props; + const { title, description, onProceed, image } = props; const { handleProceed } = useModal(); return ( @@ -16,6 +17,18 @@ const NoticeModal = (props: agendaModal) => { )}

{description}

+ {image && ( + <> + poster + + )}
diff --git a/constants/admin/agendaTable.ts b/constants/admin/agendaTable.ts index 6447040d2..aa7448878 100644 --- a/constants/admin/agendaTable.ts +++ b/constants/admin/agendaTable.ts @@ -24,7 +24,7 @@ export const agendaTableFormat: AgendaTableFormat = { ], etc: { type: 'button', - value: ['자세히', '취소', '팀 목록', '공지사항'], + value: ['자세히', '포스터', '취소', '팀 목록', '공지사항'], }, }, team: { diff --git a/types/agenda/modalTypes.ts b/types/agenda/modalTypes.ts index 433f804f1..c0d3170b4 100644 --- a/types/agenda/modalTypes.ts +++ b/types/agenda/modalTypes.ts @@ -16,4 +16,5 @@ export interface agendaModal { data?: any; stringKey?: string; isAdmin?: boolean; + image?: string; } From 880133ce7f58667b58153aeda8e469d3ffa774ef Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 00:56:31 +0900 Subject: [PATCH 04/17] =?UTF-8?q?Chore:=20agenda=20=EC=B7=A8=EC=86=8C?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=ED=9B=84=20list=20=EB=8B=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=B6=88=EB=9F=AC=EC=98=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/admin/agenda/agendaList/AgendaTable.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/admin/agenda/agendaList/AgendaTable.tsx b/components/admin/agenda/agendaList/AgendaTable.tsx index b05168347..ca365c98f 100644 --- a/components/admin/agenda/agendaList/AgendaTable.tsx +++ b/components/admin/agenda/agendaList/AgendaTable.tsx @@ -123,6 +123,7 @@ export default function AgendaTable({ status, isOfficial }: AgendaTableProps) { { agenda_key: agendaKey }, (data) => { alert('취소 요청이 성공적으로 전송되었습니다.'); + getAgendaList(); }, (error) => { alert('취소 요청에 실패했습니다: ' + error); From 88bb2190e3ec882f3e1783a20dc2d2bc004f9685 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 11:49:31 +0900 Subject: [PATCH 05/17] =?UTF-8?q?Feat:=20admin=20sideNav=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/admin/agenda/SideNavAgenda.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/admin/agenda/SideNavAgenda.tsx b/components/admin/agenda/SideNavAgenda.tsx index 8898a4b6d..63cabbde5 100644 --- a/components/admin/agenda/SideNavAgenda.tsx +++ b/components/admin/agenda/SideNavAgenda.tsx @@ -1,5 +1,7 @@ import { useRouter } from 'next/router'; -import { TbMessageReport } from 'react-icons/tb'; +import { FaRegCalendarCheck, FaRegUserCircle } from 'react-icons/fa'; +import { GrAnnounce } from 'react-icons/gr'; +import { RiTeamLine } from 'react-icons/ri'; import SideNavContent from 'components/admin/SideNavContent'; import styles from 'styles/admin/SideNav.module.scss'; @@ -11,10 +13,10 @@ export default function SideNavParty() { - + - + - + - + ); From 0f9170461f01a31a7df9c03a012d44dfb721027c Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 11:58:55 +0900 Subject: [PATCH 06/17] =?UTF-8?q?Chore:=20agenda=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=ED=83=AD=20=EA=B8=B0=EC=A4=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/agenda/agendaList/AgendaFillterTab.tsx | 12 ++++++------ components/admin/agenda/agendaList/AgendaTable.tsx | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/admin/agenda/agendaList/AgendaFillterTab.tsx b/components/admin/agenda/agendaList/AgendaFillterTab.tsx index 79c6c2cce..61e792a87 100644 --- a/components/admin/agenda/agendaList/AgendaFillterTab.tsx +++ b/components/admin/agenda/agendaList/AgendaFillterTab.tsx @@ -13,15 +13,15 @@ export default function AgendaFillterTab() { }, { contentId: 1, - contentName: '공식', + contentName: '모집 중', }, { contentId: 2, - contentName: '비공식', + contentName: '진행 중', }, { contentId: 3, - contentName: '완료된 대회', + contentName: '진행 완료', }, ]; @@ -31,13 +31,13 @@ export default function AgendaFillterTab() { setChild(); break; case 1: - setChild(); + setChild(); break; case 2: - setChild(); + setChild(); break; case 3: - setChild(); + setChild(); break; } }, [tabIdx]); diff --git a/components/admin/agenda/agendaList/AgendaTable.tsx b/components/admin/agenda/agendaList/AgendaTable.tsx index ca365c98f..03401670f 100644 --- a/components/admin/agenda/agendaList/AgendaTable.tsx +++ b/components/admin/agenda/agendaList/AgendaTable.tsx @@ -178,6 +178,7 @@ export default function AgendaTable({ status, isOfficial }: AgendaTableProps) { const getData = await instanceInAgenda.get( `/admin/request/list?page=${currentPage}&size=${itemsPerPage}` ); + const filteredAgendaList = getData.data.content.filter( (agenda: IAgenda) => { const matchesStatus = status ? agenda.agendaStatus === status : true; @@ -213,9 +214,9 @@ export default function AgendaTable({ status, isOfficial }: AgendaTableProps) { case AgendaStatus.CANCEL: return '취소'; case AgendaStatus.OPEN: - return '진행 중'; + return '모집 중'; case AgendaStatus.CONFIRM: - return '확정'; + return '진행 중'; case AgendaStatus.FINISH: return '진행완료'; default: From 732cb14bc55c36f061496fde5c100dd247059de2 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 12:29:19 +0900 Subject: [PATCH 07/17] =?UTF-8?q?Fix:=20user=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=84=9C=EC=9A=B8/=EA=B2=BD=EC=82=B0?= =?UTF-8?q?=EB=A7=8C=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Form/userForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/agenda/Form/userForm.tsx b/components/agenda/Form/userForm.tsx index d9cd2155b..f147bcc48 100644 --- a/components/agenda/Form/userForm.tsx +++ b/components/agenda/Form/userForm.tsx @@ -81,7 +81,7 @@ const UserForm = ({ stringKey }: userFormProps) => {
From 15431225a9703f7b0e33c39df7bd51ef9639caa4 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 13:40:45 +0900 Subject: [PATCH 08/17] =?UTF-8?q?Fix:=20usePageNation=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20getData=20useCallback=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/agenda/usePageNation.ts | 56 ++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/hooks/agenda/usePageNation.ts b/hooks/agenda/usePageNation.ts index 8c0bf2f27..4dafa0983 100644 --- a/hooks/agenda/usePageNation.ts +++ b/hooks/agenda/usePageNation.ts @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState, useCallback } from 'react'; import { instanceInAgenda } from 'utils/axios'; const usePageNation = ({ @@ -10,39 +10,44 @@ const usePageNation = ({ url: string; params?: Record; size?: number; // 페이지 사이즈 - useIdx?: boolean; // 인덱싱 추가 여부 : 해당 데이터 타입에 idx?: number; 추가 필요 + useIdx?: boolean; // 인덱싱 추가 여부 }) => { const currentPage = useRef(1); const [content, setContent] = useState(null); const status = useRef(0); const totalPages = useRef(1); + // 기본 파라미터 설정 if (!size) size = 20; - params = params ? params : {}; + params = params || {}; params.page = currentPage.current; params.size = size; - const getData = async (page: number, size: number) => { - const res = await instanceInAgenda.get(url, { params }); - const content = res.data.content ? res.data.content : []; - const totalSize = res.data.totalSize ? res.data.totalSize : 0; - if (useIdx) { - res.data.content = res.data.content.map((c: T, idx: number) => { - const temp = c as T & { idx: number }; - temp.idx = idx + 1 + size * (page - 1); - return temp; - }); - } - status.current = res.status; - return { totalSize, content }; - }; - // const data = getData(0); + + const getData = useCallback( + async (page: number, size: number) => { + const res = await instanceInAgenda.get(url, { params }); + const content = res.data.content ? res.data.content : []; + const totalSize = res.data.totalSize ? res.data.totalSize : 0; + + if (useIdx) { + res.data.content = res.data.content.map((c: T, idx: number) => { + const temp = c as T & { idx: number }; + temp.idx = idx + 1 + size * (page - 1); + return temp; + }); + } + + status.current = res.status; // 상태 업데이트 + return { totalSize, content }; + }, + [url, params, useIdx] + ); const pageChangeHandler = async (pageNumber: number) => { if (pageNumber < 1 || pageNumber > totalPages.current) return; - await getData(pageNumber, size).then((res) => { - currentPage.current = pageNumber; - setContent(res.content); - }); + const res = await getData(pageNumber, size); + currentPage.current = pageNumber; + setContent(res.content); }; useEffect(() => { @@ -51,8 +56,11 @@ const usePageNation = ({ totalPages.current = Math.ceil(data.totalSize / size); setContent(data.content); }; - if (!status.current || status.current / 100 != 2) fetchData(); - }, [currentPage, getData, size]); + + if (!status.current || Math.floor(status.current / 100) !== 2) { + fetchData(); + } + }, [getData, size]); // getData와 size에 의존 const PagaNationElementProps = { curPage: currentPage.current, From c1b1c837b112fa7448602a0c3e9bf6fa508eb733 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 13:41:21 +0900 Subject: [PATCH 09/17] =?UTF-8?q?Fix:=20admin=20=ED=8C=80=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20pagenation=EC=9C=84=EC=B9=98=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../announcements/AnnouncementTable.tsx | 1 - .../admin/agenda/teamList/TeamTable.tsx | 116 +++++++++--------- 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/components/admin/agenda/announcements/AnnouncementTable.tsx b/components/admin/agenda/announcements/AnnouncementTable.tsx index 915b160e7..025a8ba47 100644 --- a/components/admin/agenda/announcements/AnnouncementTable.tsx +++ b/components/admin/agenda/announcements/AnnouncementTable.tsx @@ -200,7 +200,6 @@ export default function AnnouncementTable() { totalPages={announcementInfo.totalPage} pageChangeHandler={(pageNumber: number) => { setCurrentPage(pageNumber); - fetchAnnouncementList(); }} /> diff --git a/components/admin/agenda/teamList/TeamTable.tsx b/components/admin/agenda/teamList/TeamTable.tsx index 61fd3745c..b913f1311 100644 --- a/components/admin/agenda/teamList/TeamTable.tsx +++ b/components/admin/agenda/teamList/TeamTable.tsx @@ -195,66 +195,68 @@ export default function TeamTable() { {selectedAgendaKey ? ( - - - - - {teamInfo.teamList.length > 0 ? ( - teamInfo.teamList.map((team: ITeam, index) => ( - - {agendaTableFormat['team'].columns.map( - (columnName: string, index: number) => { - return ( - - {columnName === 'teamStatus' - ? renderStatus(team.teamStatus) // 상태 표시 - : columnName === 'teamIsPrivate' - ? renderIsPrivate(team.teamIsPrivate) // 공개 여부 표시 - : columnName !== 'etc' - ? team[columnName as keyof ITeam] // 다른 열의 기본 값 표시 - : agendaTableFormat['team'].etc?.value.map( - (buttonName: string, index: number) => ( - - ) - )} - - ); - } - )} - - )) - ) : ( - - )} - -
-
+ <> + + + + + {teamInfo.teamList.length > 0 ? ( + teamInfo.teamList.map((team: ITeam, index) => ( + + {agendaTableFormat['team'].columns.map( + (columnName: string, index: number) => { + return ( + + {columnName === 'teamStatus' + ? renderStatus(team.teamStatus) // 상태 표시 + : columnName === 'teamIsPrivate' + ? renderIsPrivate(team.teamIsPrivate) // 공개 여부 표시 + : columnName !== 'etc' + ? team[columnName as keyof ITeam] // 다른 열의 기본 값 표시 + : agendaTableFormat['team'].etc?.value.map( + (buttonName: string, index: number) => ( + + ) + )} + + ); + } + )} + + )) + ) : ( + + )} + +
+
+
+ { + setCurrentPage(pageNumber); + }} + /> +
+ ) : (
아젠다를 선택해주세요.
)} -
- { - setCurrentPage(pageNumber); - }} - /> -
); } From 21d3ed97c248be07dcb82beb8693a06af73b3724 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 15:40:36 +0900 Subject: [PATCH 10/17] =?UTF-8?q?Fix:=20pagenation=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agendaDetail/tabs/AgendaAnnouncements.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx b/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx index 2025dcc97..235cceb95 100644 --- a/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx +++ b/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx @@ -23,19 +23,21 @@ export default function AgendaAnnouncements({ isHost }: { isHost: boolean }) { <>
{content && content.length > 0 ? ( - content.map((item) => ( - - )) + <> + {content.map((item) => ( + + ))} + + ) : (
공지사항이 없습니다.
)} - {isHost ? (
From e59bdf8a106d54525b97fb4e871d82c9c7b7c6a7 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 15:42:09 +0900 Subject: [PATCH 11/17] =?UTF-8?q?Feat:=20agendaInfo=EC=97=90=20tag=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Home/AgendaInfo.tsx | 2 +- components/agenda/Home/MyTeamInfo.tsx | 2 +- components/agenda/Profile/HistoryList.tsx | 2 +- components/agenda/agendaDetail/AgendaInfo.tsx | 44 ++++++++++++++++--- components/agenda/utils/AgendaTag.tsx | 7 ++- constants/agenda/agenda.ts | 8 ++-- styles/agenda/Layout/Layout.module.scss | 5 ++- .../agendaDetail/AgendaInfo.module.scss | 27 +++++------- styles/agenda/button/TabButton.module.scss | 2 +- styles/agenda/common.scss | 3 ++ styles/agenda/utils/AgendaTag.module.scss | 16 ++++++- 11 files changed, 85 insertions(+), 33 deletions(-) diff --git a/components/agenda/Home/AgendaInfo.tsx b/components/agenda/Home/AgendaInfo.tsx index d4b797add..7d8cc2aba 100644 --- a/components/agenda/Home/AgendaInfo.tsx +++ b/components/agenda/Home/AgendaInfo.tsx @@ -1,7 +1,7 @@ import Image from 'next/image'; import { AgendaDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { showPeriod, fillZero } from 'utils/handleTime'; -import AgendaTag from 'components/agenda/utils/AgendaTag'; +import { AgendaTag } from 'components/agenda/utils/AgendaTag'; import { isSoloTeam } from 'components/agenda/utils/team'; import styles from 'styles/agenda/Home/AgendaInfo.module.scss'; diff --git a/components/agenda/Home/MyTeamInfo.tsx b/components/agenda/Home/MyTeamInfo.tsx index 10f8813a7..9ac1df2a2 100644 --- a/components/agenda/Home/MyTeamInfo.tsx +++ b/components/agenda/Home/MyTeamInfo.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; import { MyTeamDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { fillZero } from 'utils/handleTime'; -import AgendaTag from 'components/agenda/utils/AgendaTag'; +import { AgendaTag } from 'components/agenda/utils/AgendaTag'; import agendastyles from 'styles/agenda/Home/AgendaInfo.module.scss'; import styles from 'styles/agenda/Home/MyTeamInfo.module.scss'; diff --git a/components/agenda/Profile/HistoryList.tsx b/components/agenda/Profile/HistoryList.tsx index 71ced63f1..4ecc6bd59 100644 --- a/components/agenda/Profile/HistoryList.tsx +++ b/components/agenda/Profile/HistoryList.tsx @@ -3,7 +3,7 @@ import { HistoryListProps, HistoryItemProps, } from 'types/agenda/profile/historyListTypes'; -import AgendaTag from 'components/agenda/utils/AgendaTag'; +import { AgendaTag } from 'components/agenda/utils/AgendaTag'; import { countHistoryCoalitions } from 'components/agenda/utils/coalition/countCoalitions'; import ColorList from 'components/agenda/utils/ColorList'; import TeamIcon from 'public/image/agenda/rock-and-roll-hand.svg'; diff --git a/components/agenda/agendaDetail/AgendaInfo.tsx b/components/agenda/agendaDetail/AgendaInfo.tsx index 5b64fad66..48d5aaea8 100644 --- a/components/agenda/agendaDetail/AgendaInfo.tsx +++ b/components/agenda/agendaDetail/AgendaInfo.tsx @@ -1,8 +1,10 @@ import { NextRouter, useRouter } from 'next/router'; +import { AgendaDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { AgendaInfoProps } from 'types/agenda/agendaDetail/tabs/agendaInfoTypes'; -import { AgendaStatus } from 'constants/agenda/agenda'; +import { AgendaLocation, AgendaStatus } from 'constants/agenda/agenda'; import { ShareBtn } from 'components/agenda/button/Buttons'; import { UploadBtn } from 'components/agenda/button/UploadBtn'; +import { DefaultTag } from 'components/agenda/utils/AgendaTag'; import { isSoloTeam } from 'components/agenda/utils/team'; import useFetchRequest from 'hooks/agenda/useFetchRequest'; import styles from 'styles/agenda/agendaDetail/AgendaInfo.module.scss'; @@ -11,6 +13,37 @@ interface CallbackProps { router: NextRouter; agendaKey: string; } +const tagButton = (data: AgendaDataProps) => { + const statusToTagName: Record = { + [AgendaStatus.CANCEL]: '취소', + [AgendaStatus.OPEN]: '모집중', + [AgendaStatus.CONFIRM]: '진행중', + [AgendaStatus.FINISH]: '완료', + }; + const LocationToTagName: Record = { + [AgendaLocation.SEOUL]: '서울', + [AgendaLocation.GYEONGSAN]: '경산', + [AgendaLocation.MIX]: '혼합', + }; + + const status = statusToTagName[data.agendaStatus]; + const location = LocationToTagName[data.agendaLocation]; + const tags = [ + data.isOfficial ? '공식' : '비공식', + data.agendaMaxPeople === 1 ? '개인' : '팀', + data.isRanking ? '대회' : null, + status, + location, + ].filter(Boolean); + + return ( +
+ {tags.map((tagName) => ( + + ))} +
+ ); +}; const copyLink = () => { const url = window.location.href; @@ -41,7 +74,7 @@ export default function AgendaInfo({ }: AgendaInfoProps) { const sendRequest = useFetchRequest().sendRequest; - const subscribeSolo = ({ router, agendaKey }: CallbackProps) => { + const subscribeSolo = ({ agendaKey }: CallbackProps) => { const soloData = { teamName: intraId, teamLocation: agendaData.agendaLocation, @@ -81,7 +114,7 @@ export default function AgendaInfo({ ); }; - const unsubscribeSolo = ({ router, agendaKey }: CallbackProps) => { + const unsubscribeSolo = ({ agendaKey }: CallbackProps) => { const myTeamKey = myTeam ? myTeam.teamKey : null; sendRequest( @@ -157,13 +190,11 @@ export default function AgendaInfo({

{agendaTitle}

- + {tagButton(agendaData)}
주최자 : {agendaHost}
- {isAgendaDetail && } - {isAgendaDetail && buttonData && ( )} + {isAgendaDetail && }
diff --git a/components/agenda/utils/AgendaTag.tsx b/components/agenda/utils/AgendaTag.tsx index c7dd1c774..aba33abe6 100644 --- a/components/agenda/utils/AgendaTag.tsx +++ b/components/agenda/utils/AgendaTag.tsx @@ -12,4 +12,9 @@ const AgendaTag: React.FC = ({ tagName }) => { ); }; -export default AgendaTag; +const DefaultTag = ({ tagName }: AgendaTagProps) => { + if (!tagName) return null; + return
#{tagName}
; +}; + +export { AgendaTag, DefaultTag }; diff --git a/constants/agenda/agenda.ts b/constants/agenda/agenda.ts index d218758d9..1df975aea 100644 --- a/constants/agenda/agenda.ts +++ b/constants/agenda/agenda.ts @@ -5,10 +5,10 @@ export const enum AgendaLocation { } export const enum AgendaStatus { - CANCEL = 'CANCEL', - OPEN = 'OPEN', - CONFIRM = 'CONFIRM', - FINISH = 'FINISH', + CANCEL = 'CANCEL', // 취소 + OPEN = 'OPEN', // 모집 중 + CONFIRM = 'CONFIRM', // 진행 중 + FINISH = 'FINISH', // 진행 완료 } export const enum TeamStatus { diff --git a/styles/agenda/Layout/Layout.module.scss b/styles/agenda/Layout/Layout.module.scss index 02fb3febf..3fc6fcb16 100644 --- a/styles/agenda/Layout/Layout.module.scss +++ b/styles/agenda/Layout/Layout.module.scss @@ -29,13 +29,14 @@ font-size: var(--font-size-xl); color: white; cursor: pointer; - background-color: var(--highlight-violet); + + background-color: var(--highlight-yellow); border: none; border-radius: $radius-circle; box-shadow: var(--box-shadow-light); transition: background-color 0.3s; &:hover { - background-color: var(--highlight-yellow); + background-color: var(--highlight-violet); } } diff --git a/styles/agenda/agendaDetail/AgendaInfo.module.scss b/styles/agenda/agendaDetail/AgendaInfo.module.scss index 494e357c2..ba9dc5d91 100644 --- a/styles/agenda/agendaDetail/AgendaInfo.module.scss +++ b/styles/agenda/agendaDetail/AgendaInfo.module.scss @@ -43,7 +43,7 @@ $info-gradient: linear-gradient( bottom: 1.5rem; left: 1.5rem; @media screen and (min-width: 961px) { - bottom: 0.3rem; + bottom: 1rem; } } @@ -59,18 +59,10 @@ $info-gradient: linear-gradient( align-items: center; gap: 1rem; } -} -.titleWarp { - display: flex; - align-items: center; - width: 100%; - gap: 1.5rem; - @media screen and (max-width: 961px) { - justify-content: space-between; - } h2 { - @include text('agenda-title'); + @include text('date'); + margin: 0.5rem 0; } } @@ -89,17 +81,22 @@ $info-gradient: linear-gradient( display: flex; // flex 컨테이너로 설정 flex-direction: column; // 기본적으로 세로 정렬 align-items: flex-end; // 오른쪽 정렬 - gap: 0.4rem; + gap: 0.8rem; @media screen and (max-width: 960px) { - bottom: 100%; // 960px 이하에서 세로 정렬 + bottom: 56%; } @media screen and (min-width: 961px) { - bottom: 26%; // 961px 이상에서 위치 조정 - flex-direction: row; // 가로 배치 + bottom: 18%; + flex-direction: row-reverse; // 가로 배치 justify-content: flex-end; // 오른쪽 정렬 align-items: center; // 세로 중앙 정렬 gap: 1rem; } } + +.agendaItemTagBox { + display: flex; + gap: 0.3rem; +} diff --git a/styles/agenda/button/TabButton.module.scss b/styles/agenda/button/TabButton.module.scss index 241e8075f..b7f7ca0c8 100644 --- a/styles/agenda/button/TabButton.module.scss +++ b/styles/agenda/button/TabButton.module.scss @@ -21,6 +21,6 @@ } &.isActive { - background: var(--highlight-yellow-light); + background: var(--highlight-yellow); } } diff --git a/styles/agenda/common.scss b/styles/agenda/common.scss index 3cb532e97..0d987b143 100644 --- a/styles/agenda/common.scss +++ b/styles/agenda/common.scss @@ -177,6 +177,9 @@ $font-size-xs: 0.8rem; // $small-font // 제목 뒤에 붙는 설명 font-family: $font-text-light; font-size: $font-size-xs; + } @else if ($type == 'description-regular') { + font-family: $font-text-regular; + font-size: $font-size-xs; } @else if ($type == 'agenda-title') { font-family: $font-text-bold; font-size: $font-size-xl; diff --git a/styles/agenda/utils/AgendaTag.module.scss b/styles/agenda/utils/AgendaTag.module.scss index 34e2a9206..b4439a136 100644 --- a/styles/agenda/utils/AgendaTag.module.scss +++ b/styles/agenda/utils/AgendaTag.module.scss @@ -23,5 +23,19 @@ $tags: ( border-radius: $radius-medium; justify-content: center; align-items: center; - @include text(description); + @include text(description-regular); +} + +.defaultTag { + display: flex; + width: 3.3rem; + height: 1.2rem; + padding: 0.2rem; + + background-color: var(--box-bg-2-light); + // box-shadow: var(--box-shadow-light); + border-radius: $radius-medium; + justify-content: center; + align-items: center; + @include text(description-regular); } From 2de47b236a84fc1ff783c79e33836e764c9bbeed Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 16:02:51 +0900 Subject: [PATCH 12/17] =?UTF-8?q?Style:=20team=20=EC=88=98=EC=A0=95=20widt?= =?UTF-8?q?h=20=EB=93=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/admin/agenda/teamModify.tsx | 21 +++++++++++---------- styles/agenda/pages/create-team.module.scss | 7 +++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pages/admin/agenda/teamModify.tsx b/pages/admin/agenda/teamModify.tsx index 6e6715c98..97773e880 100644 --- a/pages/admin/agenda/teamModify.tsx +++ b/pages/admin/agenda/teamModify.tsx @@ -13,16 +13,17 @@ const TeamModify = () => { return ( <> -
-

팀 수정하기

-

팀 인원 : 3명-8명까지 가능

- {teamData && ( - - )} +
+
+

팀 수정하기

+ {teamData && ( + + )} +
); diff --git a/styles/agenda/pages/create-team.module.scss b/styles/agenda/pages/create-team.module.scss index 7d47e1377..d0f922217 100644 --- a/styles/agenda/pages/create-team.module.scss +++ b/styles/agenda/pages/create-team.module.scss @@ -15,3 +15,10 @@ @include text('title'); margin: 0 0 1rem; } + +.modifyContainer { + display: flex; + flex-direction: column; + align-items: center; + margin: 2rem 5rem; +} From f6583597a98e9c28d0268bdb3af0574be658d2d5 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 3 Sep 2024 16:22:39 +0900 Subject: [PATCH 13/17] =?UTF-8?q?Fix:=20=EB=B0=9C=EA=B8=89=EC=B2=98/?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=B2=98=20=EC=97=86=EC=96=B4=EB=8F=84=20?= =?UTF-8?q?=ED=8F=BC=20=EC=A0=9C=EC=B6=9C=20=EA=B0=80=EB=8A=A5,=20select?= =?UTF-8?q?=EC=97=90=20=EA=B8=B0=EB=B3=B8=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Form/AdminTicketForm.tsx | 16 ++++++---------- components/agenda/Form/TicketForm.tsx | 5 +++++ components/agenda/Input/AgendaSelect.tsx | 6 +++--- styles/agenda/Form/Form.module.scss | 3 +++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/components/agenda/Form/AdminTicketForm.tsx b/components/agenda/Form/AdminTicketForm.tsx index 67550231d..e269269b8 100644 --- a/components/agenda/Form/AdminTicketForm.tsx +++ b/components/agenda/Form/AdminTicketForm.tsx @@ -50,15 +50,6 @@ const AdminTicketForm = ({ stringKey, data, onProceed }: userFormProps) => { jsonData.isApproved = isApproved; jsonData.isUsed = isUsed; - if (!jsonData.issuedFromKey) { - alert('발급처는 반드시 선택해야 합니다.'); - return; - } - if ((jsonData.isUsed || jsonData.usedAt) && !jsonData.usedToKey) { - alert('사용처는 반드시 선택해야 합니다.'); - return; - } - sendRequest( 'PATCH', 'admin/ticket', @@ -81,14 +72,18 @@ const AdminTicketForm = ({ stringKey, data, onProceed }: userFormProps) => { className={styles.container} >
-
IntraId : {stringKey}
+
IntraId : {stringKey}
+
+ 발급처를 선택하지 않으면 42Intra 로 발급됩니다. +

발급처

@@ -97,6 +92,7 @@ const AdminTicketForm = ({ stringKey, data, onProceed }: userFormProps) => { selectedKey={usedToKey} dataList={agendaList} handleSelectChange={handleusedTo} + defaultSelect='42Intra' />
diff --git a/components/agenda/Form/TicketForm.tsx b/components/agenda/Form/TicketForm.tsx index 056b01b8a..9fd820c41 100644 --- a/components/agenda/Form/TicketForm.tsx +++ b/components/agenda/Form/TicketForm.tsx @@ -54,10 +54,15 @@ const TicketForm = ({ stringKey }: userFormProps) => { >
IntraId : {stringKey}
+
발급처
+

+ 발급처를 선택하지 않으면 42Intra 로 발급됩니다. +

diff --git a/components/agenda/Input/AgendaSelect.tsx b/components/agenda/Input/AgendaSelect.tsx index 7d441ca92..392960be9 100644 --- a/components/agenda/Input/AgendaSelect.tsx +++ b/components/agenda/Input/AgendaSelect.tsx @@ -6,18 +6,18 @@ interface AgendaSelectProps { selectedKey: string; dataList: any; handleSelectChange: (event: { target: { value: any } }) => void; + defaultSelect?: string; } const AgendaSelect = ({ selectedKey, dataList, handleSelectChange, + defaultSelect = 'Choose an agenda...', }: AgendaSelectProps) => { return (