diff --git a/components/Pagination.tsx b/components/Pagination.tsx index 66b02fd0e..207ad7f9f 100644 --- a/components/Pagination.tsx +++ b/components/Pagination.tsx @@ -22,7 +22,7 @@ function PageNation({ const router = useRouter(); return (
- {!!totalPages && ( + {totalPages && totalPages > 1 && ( ) => { if (!e.target.value) return; const newEnd = new Date(e.target.value); + console.log(newEnd); checkWarn(newEnd, 0); setRecruitEnd(new Date(e.target.value)); }; @@ -124,6 +126,10 @@ const AgendaForm = ({ const newWarning = [...dateWarn]; const DateValues = [recruitEnd, dateRange[0], dateRange[1]]; DateValues[index] = newDate; + tommorrow.setHours(0); + tommorrow.setMinutes(0); + tommorrow.setSeconds(0); + tommorrow.setMilliseconds(0); // 모집마감일 오류 if (DateValues[0].getTime() < tommorrow.getTime()) { newWarning[0] = '내일 이후의 날짜를 선택해주세요'; diff --git a/components/agenda/Home/MyAgendaBtn.tsx b/components/agenda/Home/MyAgendaBtn.tsx index 9781cb51c..318aa94a4 100644 --- a/components/agenda/Home/MyAgendaBtn.tsx +++ b/components/agenda/Home/MyAgendaBtn.tsx @@ -55,14 +55,7 @@ const MyAgendaBtn = () => {
{myList.length > 0 ? ( myList.map((myTeamInfo, idx) => ( - -
- -
- + )) ) : (
There is no agenda
diff --git a/components/agenda/Home/MyTeamInfo.tsx b/components/agenda/Home/MyTeamInfo.tsx index ff8de004a..10f8813a7 100644 --- a/components/agenda/Home/MyTeamInfo.tsx +++ b/components/agenda/Home/MyTeamInfo.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link'; import { MyTeamDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { fillZero } from 'utils/handleTime'; import AgendaTag from 'components/agenda/utils/AgendaTag'; @@ -15,39 +16,51 @@ const MyTeamInfo = ({ if (!myTeamInfo) { return
참가중인 일정이 없습니다.
; } - // myTeamInfo.isOfficial = true; //css test const startDate = new Date(myTeamInfo.agendaStartTime as string); - //아래 주석달린 부분은 api 변경시 추가 예정입니다. + return ( -
-
-
- {fillZero(`${startDate.getMonth()}`, 2)} -
+ +
+
+
+ {fillZero(`${startDate.getMonth()}`, 2)} +
-
- {fillZero(`${startDate.getDate()}`, 2)} -
-
-
-
-

- 팀이름 : {myTeamInfo.agendaTitle} -

- {/*
- {myTeamInfo.isOfficial ? : ''} -
*/} +
+ {fillZero(`${startDate.getDate()}`, 2)} +
-
-

- 아젠다 : {myTeamInfo.agendaTitle} -

-
- {myTeamInfo.isOfficial ? : ''} +
+
+ {myTeamInfo.teamName ? ( + <> +

{myTeamInfo.teamName}

+
+ {myTeamInfo.teamStatus === 'OPEN' ? ( + + ) : ( + + )} +
+ + ) : ( + '' + )} +
+
+

{myTeamInfo.agendaTitle}

+
+ {myTeamInfo.isOfficial ? : ''} +
-
+ ); }; diff --git a/components/agenda/Profile/CurrentList.tsx b/components/agenda/Profile/CurrentList.tsx index f3f7f0aa8..6591eb7ea 100644 --- a/components/agenda/Profile/CurrentList.tsx +++ b/components/agenda/Profile/CurrentList.tsx @@ -1,10 +1,15 @@ -import { - CurrentListProps, - CurrentItemProps, -} from 'types/agenda/profile/currentListTypes'; +import Link from 'next/link'; +import { MyTeamDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import styles from 'styles/agenda/Profile/CurrentList.module.scss'; +import MyTeamInfo from '../Home/MyTeamInfo'; -const CurrentList = ({ currentListData, isHost }: CurrentListProps) => { +const CurrentList = ({ + currentListData, + isHost, +}: { + currentListData: MyTeamDataProps[]; + isHost: boolean; +}) => { const listTitle = isHost ? '개최중 아젠다' : '참여중 아젠다'; return (
@@ -12,10 +17,9 @@ const CurrentList = ({ currentListData, isHost }: CurrentListProps) => {
{currentListData.length !== 0 ? ( - currentListData.map((data: CurrentItemProps) => ( -
-
{data.agendaTitle}
-
{data.teamName}
+ currentListData.map((data: MyTeamDataProps, idx: number) => ( +
+
)) ) : ( diff --git a/components/agenda/Ticket/Ticket.tsx b/components/agenda/Ticket/Ticket.tsx index 56003d8a1..70ddbaa0b 100644 --- a/components/agenda/Ticket/Ticket.tsx +++ b/components/agenda/Ticket/Ticket.tsx @@ -13,8 +13,7 @@ const Ticket = ({ type }: { type: string }) => { const { openModal } = useModal(); return ( -
- {' '} + <> {type === 'page' ? (

내 티켓

@@ -87,7 +86,7 @@ const Ticket = ({ type }: { type: string }) => {
)} -
+ ); }; diff --git a/components/agenda/agendaDetail/TabContent.tsx b/components/agenda/agendaDetail/TabContent.tsx index b37212072..376982af5 100644 --- a/components/agenda/agendaDetail/TabContent.tsx +++ b/components/agenda/agendaDetail/TabContent.tsx @@ -3,6 +3,7 @@ import AgendaAnnouncements from 'components/agenda/agendaDetail/tabs/AgendaAnnou import AgendaConditions from 'components/agenda/agendaDetail/tabs/AgendaConditions'; import AgendaDescription from 'components/agenda/agendaDetail/tabs/AgendaDescription'; import AgendaParticipants from 'components/agenda/agendaDetail/tabs/AgendaParticipants'; +import AgendaPoster from 'components/agenda/agendaDetail/tabs/AgendaPoster'; import styles from 'styles/agenda/agendaDetail/AgendaTab.module.scss'; export default function TabContent({ @@ -22,6 +23,8 @@ export default function TabContent({ return ; case tabs.CONDITIONS: return ; + case tabs.POSTER: + return ; default: return null; } diff --git a/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx b/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx index ba579ccf4..2025dcc97 100644 --- a/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx +++ b/components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx @@ -3,7 +3,6 @@ import { AnnouncementProps } from 'types/agenda/agendaDetail/announcementTypes'; import AnnouncementItem from 'components/agenda/agendaDetail/tabs/AnnouncementItem'; import { UploadBtn } from 'components/agenda/button/UploadBtn'; import PageNation from 'components/Pagination'; -// import useFetchGet from 'hooks/agenda/useFetchGet'; import usePageNation from 'hooks/agenda/usePageNation'; import styles from 'styles/agenda/agendaDetail/tabs/AgendaAnnouncements.module.scss'; @@ -11,20 +10,11 @@ export default function AgendaAnnouncements({ isHost }: { isHost: boolean }) { const router = useRouter(); const { agendaKey } = router.query; - // !! page, size 변수로 변경 - // const params = { agenda_key: agendaKey, page: 1, size: 20 }; - // const content: AnnouncementProps[] | null = useFetchGet< - // AnnouncementProps[] - // >(`/announcement`, params).data; - const { content, PagaNationElementProps } = usePageNation({ url: `/announcement`, params: { agenda_key: agendaKey }, }); - if (!content) { - return
Loading...
; - } const newAnnouncement = () => { router.push(`/agenda/${agendaKey}/host/createAnnouncement`); }; @@ -32,7 +22,7 @@ export default function AgendaAnnouncements({ isHost }: { isHost: boolean }) { return ( <>
- {content && + {content && content.length > 0 ? ( content.map((item) => ( - ))} + )) + ) : ( +
공지사항이 없습니다.
+ )} {isHost ? ( diff --git a/components/agenda/agendaDetail/tabs/AgendaDescription.tsx b/components/agenda/agendaDetail/tabs/AgendaDescription.tsx index 2167bae35..0ecc46526 100644 --- a/components/agenda/agendaDetail/tabs/AgendaDescription.tsx +++ b/components/agenda/agendaDetail/tabs/AgendaDescription.tsx @@ -4,7 +4,7 @@ import styles from 'styles/agenda/agendaDetail/tabs/AgendaDescription.module.scs export default function AgendaDescription({ agendaData }: AgendaProps) { const { - agendaContents, + agendaContent, agendaDeadLine, agendaStartTime, agendaEndTime, @@ -18,7 +18,7 @@ export default function AgendaDescription({ agendaData }: AgendaProps) {
대회 정보
-

간단 설명

{agendaContents} +

간단 설명

{agendaContent}

모집 완료 기간

~ {formatDate(agendaDeadLine)} diff --git a/components/agenda/agendaDetail/tabs/AgendaParticipants.tsx b/components/agenda/agendaDetail/tabs/AgendaParticipants.tsx index 1167adfc9..db80c2972 100644 --- a/components/agenda/agendaDetail/tabs/AgendaParticipants.tsx +++ b/components/agenda/agendaDetail/tabs/AgendaParticipants.tsx @@ -17,7 +17,11 @@ export default function AgendaParticipants({ {isSoloTeam(agendaMinPeople, agendaMaxPeople) ? ( ) : ( - + )}
diff --git a/components/agenda/agendaDetail/tabs/AgendaPoster.tsx b/components/agenda/agendaDetail/tabs/AgendaPoster.tsx new file mode 100644 index 000000000..6e78fbb1a --- /dev/null +++ b/components/agenda/agendaDetail/tabs/AgendaPoster.tsx @@ -0,0 +1,27 @@ +import Image from 'next/image'; +import styles from 'styles/agenda/agendaDetail/AgendaTab.module.scss'; + +interface AgendaPosterProps { + poster: string | null | undefined; +} + +const AgendaPoster = ({ poster }: AgendaPosterProps) => { + return ( +
+ {poster ? ( + poster + ) : ( +
등록된 포스터가 없습니다.
+ )} +
+ ); +}; + +export default AgendaPoster; diff --git a/components/agenda/agendaDetail/tabs/ParticipantTeamList.tsx b/components/agenda/agendaDetail/tabs/ParticipantTeamList.tsx index 4a335ba21..c9f32a48a 100644 --- a/components/agenda/agendaDetail/tabs/ParticipantTeamList.tsx +++ b/components/agenda/agendaDetail/tabs/ParticipantTeamList.tsx @@ -7,7 +7,8 @@ import usePageNation from 'hooks/agenda/usePageNation'; import styles from 'styles/agenda/agendaDetail/tabs/ParticipantTeamList.module.scss'; export default function ParticipantTeamList({ - max, + maxTeam, + maxPeople, myTeam, }: ParticipantTeamListProps) { const router = useRouter(); @@ -35,62 +36,76 @@ export default function ParticipantTeamList({ if (!agendaKey) { return
Loading...
; } + const noParticipants = ( +
팀이 없습니다.
+ ); return ( <> - {myTeam ? ( -
-
내 팀
- - -
- ) : null} +
+
내 팀
+ {myTeam ? ( + <> + + + ) : ( + noParticipants + )} +
모집중인 팀 {openTeamsCount}
- {openTeams - ? openTeams.map((team) => ( + {openTeams && openTeamsCount > 0 ? ( + <> + {openTeams.map((team) => ( - )) - : null} - + ))} + + + ) : ( + noParticipants + )}
- 확정완료 팀 {confirmedTeamsCount} / {max} + 확정완료 팀 {confirmedTeamsCount} / {maxTeam}
- {confirmedTeams - ? confirmedTeams.map((team) => ( + {confirmedTeams && confirmedTeamsCount > 0 ? ( + <> + {confirmedTeams.map((team) => ( - )) - : null} - + ))} + + + ) : ( + noParticipants + )}
); diff --git a/components/agenda/agendaDetail/tabs/ParticipantsList.tsx b/components/agenda/agendaDetail/tabs/ParticipantsList.tsx index 7723207e3..693f09e6a 100644 --- a/components/agenda/agendaDetail/tabs/ParticipantsList.tsx +++ b/components/agenda/agendaDetail/tabs/ParticipantsList.tsx @@ -20,7 +20,7 @@ export default function ParticipantsList({ max }: numberProps) { const curPeople = participants ? participants.length : 0; if (!participants) { - return
Loading...
; + return
Loading...
; } return ( @@ -28,18 +28,22 @@ export default function ParticipantsList({ max }: numberProps) {
참여자 {curPeople} / {max}
-
-
- {participants.map((participant, index) => ( - - ))} + {curPeople > 0 ? ( +
+
+ {participants.map((participant, index) => ( + + ))} +
+
- -
+ ) : ( +
참여자가 없습니다.
+ )} ); } diff --git a/components/takgu/modal/event/WelcomeModal.tsx b/components/takgu/modal/event/WelcomeModal.tsx index 8f7ff6e77..511069172 100644 --- a/components/takgu/modal/event/WelcomeModal.tsx +++ b/components/takgu/modal/event/WelcomeModal.tsx @@ -53,6 +53,7 @@ export default function WelcomeModal() { const res = await instance.post(`/pingpong/users/attendance`); const updatedcoin = res.data; if (!updatedcoin) return; + queryClient.invalidateQueries('user'); setModal({ modalName: 'COIN-ANIMATION', CoinResult: { diff --git a/constants/agenda/agendaDetail/agendaTabs.ts b/constants/agenda/agendaDetail/agendaTabs.ts index bdd6f9b1a..b8c70ab61 100644 --- a/constants/agenda/agendaDetail/agendaTabs.ts +++ b/constants/agenda/agendaDetail/agendaTabs.ts @@ -3,6 +3,7 @@ export const TABS = { PARTICIPANTS: '참여자', NOTIFICATIONS: '공지', CONDITIONS: '조건', + POSTER: '포스터', } as const; export type TabKeys = keyof typeof TABS; diff --git a/pages/agenda/profile/[intraId]/index.tsx b/pages/agenda/profile/[intraId]/index.tsx index ec272651c..62f9df213 100644 --- a/pages/agenda/profile/[intraId]/index.tsx +++ b/pages/agenda/profile/[intraId]/index.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router'; -import { CurrentItemProps } from 'types/agenda/profile/currentListTypes'; +import { MyTeamDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { HistoryItemProps } from 'types/agenda/profile/historyListTypes'; import { ProfileDataProps } from 'types/agenda/profile/profileDataTypes'; import AgendaUserSearchBar from 'components/agenda/Profile/AgendaUserSearchBar'; @@ -25,17 +25,20 @@ const AgendaProfile = () => { isMyProfile ? '/profile' : `/profile/${intraId}` ); + // host current const { content: hostCurrentListData, PagaNationElementProps: PagaNationHostCurrent, - } = usePageNation({ + } = usePageNation({ url: `/host/current/list/${intraId}`, }); - const currentListData = useFetchGet( + // current team + const currentListData = useFetchGet( '/profile/current/list' ).data; + // host history const { content: hostHistoryListData, PagaNationElementProps: PagaNationHostHistory, @@ -43,6 +46,7 @@ const AgendaProfile = () => { url: `/host/history/list/${intraId}`, }); + // history const { content: historyListData, PagaNationElementProps: PagaNationHistory, diff --git a/pages/agenda/ticket/index.tsx b/pages/agenda/ticket/index.tsx index 29e8baf52..f4cfe08e1 100644 --- a/pages/agenda/ticket/index.tsx +++ b/pages/agenda/ticket/index.tsx @@ -1,7 +1,11 @@ import Ticket from 'components/agenda/Ticket/Ticket'; - +import styles from 'styles/agenda/Ticket/Ticket.module.scss'; const ticket = () => { - return ; + return ( +
+ ; +
+ ); }; export default ticket; diff --git a/public/buttons/addElem.svg b/public/image/buttons/addElem.svg similarity index 100% rename from public/buttons/addElem.svg rename to public/image/buttons/addElem.svg diff --git a/public/buttons/cancel.svg b/public/image/buttons/cancel.svg similarity index 100% rename from public/buttons/cancel.svg rename to public/image/buttons/cancel.svg diff --git a/public/buttons/delete.svg b/public/image/buttons/delete.svg similarity index 100% rename from public/buttons/delete.svg rename to public/image/buttons/delete.svg diff --git a/public/buttons/drag.svg b/public/image/buttons/drag.svg similarity index 100% rename from public/buttons/drag.svg rename to public/image/buttons/drag.svg diff --git a/public/buttons/removeElem.svg b/public/image/buttons/removeElem.svg similarity index 100% rename from public/buttons/removeElem.svg rename to public/image/buttons/removeElem.svg diff --git a/public/buttons/share.svg b/public/image/buttons/share.svg similarity index 100% rename from public/buttons/share.svg rename to public/image/buttons/share.svg diff --git a/public/buttons/toLeft.svg b/public/image/buttons/toLeft.svg similarity index 100% rename from public/buttons/toLeft.svg rename to public/image/buttons/toLeft.svg diff --git a/public/buttons/toRight.svg b/public/image/buttons/toRight.svg similarity index 100% rename from public/buttons/toRight.svg rename to public/image/buttons/toRight.svg diff --git a/styles/agenda/Home/MyTeamInfo.module.scss b/styles/agenda/Home/MyTeamInfo.module.scss index 3d5c02973..04d02a04d 100644 --- a/styles/agenda/Home/MyTeamInfo.module.scss +++ b/styles/agenda/Home/MyTeamInfo.module.scss @@ -2,6 +2,12 @@ .Container { display: flex; + max-width: 100%; + padding: 0.5rem 1rem; + background-color: var(--box-bg-1); + border: var(--default-border); + border-radius: $radius-medium; + box-shadow: var(--default-box-shadow); gap: 1rem; } diff --git a/styles/agenda/agendaDetail/AgendaTab.module.scss b/styles/agenda/agendaDetail/AgendaTab.module.scss index f144f1c39..0fd58ca5f 100644 --- a/styles/agenda/agendaDetail/AgendaTab.module.scss +++ b/styles/agenda/agendaDetail/AgendaTab.module.scss @@ -1,5 +1,17 @@ @import 'styles/agenda/common.scss'; +.container { + @include container(1); + width: 100%; + flex: 1 0 0; + + flex-direction: column; + padding: 1.5rem; + margin: 0; + gap: 1rem; + align-items: flex-start; +} + .contentWarp { display: flex; width: 100%; diff --git a/styles/agenda/agendaDetail/tabs/AgendaAnnouncements.module.scss b/styles/agenda/agendaDetail/tabs/AgendaAnnouncements.module.scss index 9360aa4de..702ce8516 100644 --- a/styles/agenda/agendaDetail/tabs/AgendaAnnouncements.module.scss +++ b/styles/agenda/agendaDetail/tabs/AgendaAnnouncements.module.scss @@ -11,3 +11,15 @@ display: flex; justify-content: center; } + +.container { + @include container(1); + width: 100%; + flex: 1 0 0; + + flex-direction: column; + padding: 1.5rem; + margin: 0; + gap: 1rem; + align-items: flex-start; +} diff --git a/styles/agenda/agendaDetail/tabs/ParticipantTeamList.module.scss b/styles/agenda/agendaDetail/tabs/ParticipantTeamList.module.scss index 37f215df1..d36a4e6f2 100644 --- a/styles/agenda/agendaDetail/tabs/ParticipantTeamList.module.scss +++ b/styles/agenda/agendaDetail/tabs/ParticipantTeamList.module.scss @@ -12,3 +12,12 @@ .participantsTitle { @include text('sub-title'); } + +.noParticipants { + @include text('default'); + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} diff --git a/styles/agenda/agendaDetail/tabs/ParticipantsList.module.scss b/styles/agenda/agendaDetail/tabs/ParticipantsList.module.scss index 1afd5b2b0..69249273e 100644 --- a/styles/agenda/agendaDetail/tabs/ParticipantsList.module.scss +++ b/styles/agenda/agendaDetail/tabs/ParticipantsList.module.scss @@ -18,3 +18,12 @@ gap: 2rem; width: 100%; } + +.noParticipants { + @include text('default'); + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} diff --git a/styles/agenda/button/Buttons.module.scss b/styles/agenda/button/Buttons.module.scss index 02ee53ab5..9e101eae6 100644 --- a/styles/agenda/button/Buttons.module.scss +++ b/styles/agenda/button/Buttons.module.scss @@ -21,23 +21,23 @@ } .CancelBtn { - background: url('/buttons/cancel.svg') no-repeat center; + background: url('/image/buttons/cancel.svg') no-repeat center; } .ShareBtn { - background: url('/buttons/share.svg') no-repeat center; + background: url('/image/buttons/share.svg') no-repeat center; } .BackwardBtn { - background: url('/buttons/backward.svg') no-repeat center; + background: url('/image/buttons/backward.svg') no-repeat center; } .ForwardBtn { - background: url('/buttons/forward.svg') no-repeat center; + background: url('/image/buttons/forward.svg') no-repeat center; } .RemoveElementBtn { - background: url('/buttons/removeElem.svg') no-repeat center; + background: url('/image/buttons/removeElem.svg') no-repeat center; } .AddElementBtn { - background: url('/buttons/addElem.svg') no-repeat center; + background: url('/image/buttons/addElem.svg') no-repeat center; } .DragBtn { - background: url('/buttons/drag.svg') no-repeat center; + background: url('/image/buttons/drag.svg') no-repeat center; } diff --git a/types/agenda/agendaDetail/agendaTypes.ts b/types/agenda/agendaDetail/agendaTypes.ts index a5bf76fdb..a8e699efd 100644 --- a/types/agenda/agendaDetail/agendaTypes.ts +++ b/types/agenda/agendaDetail/agendaTypes.ts @@ -2,7 +2,7 @@ import { AgendaLocation, AgendaStatus } from 'constants/agenda/agenda'; export interface AgendaDataProps { agendaTitle: string; - agendaContents: string; + agendaContent: string; agendaDeadLine: Date | string; // format: 2024-09-01T04:35:07 agendaStartTime: Date | string; agendaEndTime: Date | string; @@ -34,8 +34,8 @@ export interface MyTeamDataProps { agendaTitle: string; agendaLocation: string; // ENUM 상단참고 agendaStartTime?: Date | string; - teamStatus: string; - teamKey: string; // 내 팀 조회를 위한 key + teamStatus?: string; + teamKey?: string; // 내 팀 조회를 위한 key isOfficial: boolean; //공식대회여부 - teamName: string; //fe 추가 0728 : 와이어프레임 참고 + teamName?: string; //fe 추가 0728 : 와이어프레임 참고 } diff --git a/types/agenda/agendaDetail/tabs/participantTypes.ts b/types/agenda/agendaDetail/tabs/participantTypes.ts index 8692942ff..448e3dab6 100644 --- a/types/agenda/agendaDetail/tabs/participantTypes.ts +++ b/types/agenda/agendaDetail/tabs/participantTypes.ts @@ -16,7 +16,8 @@ export interface ParticipantTabProps { } export interface ParticipantTeamListProps { - max: number; + maxTeam: number; + maxPeople: number; myTeam?: TeamDataProps | null; } diff --git a/types/agenda/profile/currentListTypes.ts b/types/agenda/profile/currentListTypes.ts deleted file mode 100644 index 8ad619faf..000000000 --- a/types/agenda/profile/currentListTypes.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface CurrentItemProps { - agendaId: string; - agendaTitle: string; - agendaLocation: string; - teamKey: string; - isOfficial: boolean; - teamName: string; -} - -export interface CurrentListProps { - currentListData: CurrentItemProps[]; - isHost: boolean; -}