-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat] 현황 full 기능 구현 #530
Merged
Merged
[Feat] 현황 full 기능 구현 #530
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
508b409
refactor: tab hook 분리
sumi-0011 933f54c
feat: 결과 페이지 캘린더 추가
sumi-0011 eb8029f
feat: summary data 상단 채우기
sumi-0011 a7faed8
feat: 캘린더 미션 내역 추가
sumi-0011 d1ada53
feat: 캐릭터 섹션 디자인 변경
sumi-0011 b80cbe2
feat: 레벨 안내 링크 위치 조정
sumi-0011 0c7d952
style: banner card 동적 width로 변경
sumi-0011 18463cd
Merge branch 'develop' into feat/status-full
sumi-0011 1aef2db
feat: mission list style fix
sumi-0011 2e90d10
style: 미션탭 > 프로필 영역 한줄 벗어나면 말줄임 처리되면 좋겠어요!
sumi-0011 611da93
style: 미션탭 > 프로필 영역 스와이프 시 잘리는 부분이 보이는 이슈
sumi-0011 0268620
style: width 추가
sumi-0011 677bcc7
style: card banner border fix
sumi-0011 6c6a1d5
refactor: ImageAreaSection로 분리
sumi-0011 cc3f02a
feat: image section 개발
sumi-0011 da7613a
feat: banner section 분리, 스켈레톤 추가
sumi-0011 e46dfe3
feat: result 페이지 스켈레톤 추가
sumi-0011 9e43063
refactor: 스켈레톤 구조 변경
sumi-0011 3664ee8
refactor: mission list loading 추가
sumi-0011 bb7dbae
style: text 크기 수정
sumi-0011 0bb2540
Merge branch 'develop' into feat/status-full
sumi-0011 4d2fece
feat: api 연결 완
sumi-0011 d1e4d5e
refactor: 우병오빠 리뷰 적용
sumi-0011 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
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 |
---|---|---|
|
@@ -40,6 +40,9 @@ type QueryList = { | |
feed: { | ||
memberId: number; | ||
}; | ||
missionSummaryList: { | ||
date: string; | ||
}; | ||
}; | ||
|
||
/** | ||
|
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,59 @@ | ||
import getQueryKey from '@/apis/getQueryKey'; | ||
import { MissionCategory, MissionStatus } from '@/apis/schema/mission'; | ||
import { useQuery, type UseQueryOptions } from '@tanstack/react-query'; | ||
|
||
interface MissionSummaryType { | ||
missionId: number; | ||
name: string; | ||
category: MissionCategory; | ||
visibility: string; | ||
missionStatus: MissionStatus; | ||
} | ||
|
||
interface MissionSummaryListResponse { | ||
missionAllCount: number; | ||
missionCompleteCount: number; | ||
missionNoneCount: number; | ||
missionList: MissionSummaryType[]; | ||
} | ||
|
||
const MissionSummaryListData: MissionSummaryListResponse = { | ||
missionAllCount: 0, | ||
missionCompleteCount: 0, | ||
missionNoneCount: 0, | ||
missionList: [ | ||
{ | ||
missionId: 1, | ||
name: 'UX방법론 1챕터씩 공부하기!', | ||
category: MissionCategory.STUDY, | ||
visibility: 'ALL', | ||
missionStatus: MissionStatus.COMPLETED, | ||
}, | ||
{ | ||
missionId: 2, | ||
name: '스쿼트하고 닭다리 되기!', | ||
category: MissionCategory.STUDY, | ||
visibility: 'ALL', | ||
missionStatus: MissionStatus.NONE, | ||
}, | ||
], | ||
}; | ||
|
||
const RESULT_API = { | ||
getMissionSummaryList: async (_: string): Promise<MissionSummaryListResponse> => { | ||
// // const { data } = await apiInstance.get(`/missions/summary-list?date=${date}`); | ||
// const { data } = await apiInstance.get(`/missions/summary-list`); | ||
// return data; | ||
return MissionSummaryListData; | ||
}, | ||
}; | ||
|
||
export default RESULT_API; | ||
|
||
export const useGetMissionSummaryList = (date: string, option?: UseQueryOptions<MissionSummaryListResponse>) => { | ||
return useQuery<MissionSummaryListResponse>({ | ||
queryKey: getQueryKey('missionSummaryList', { date }), | ||
queryFn: () => RESULT_API.getMissionSummaryList(date), | ||
...option, | ||
}); | ||
}; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
import CalendarItem from '@/app/result/OverallStatus/CalendarItem'; | ||
import Icon from '@/components/Icon'; | ||
import { WEEK_DAYS } from '@/components/MissionDetail/MissionCalender/MissionCalendar.constants'; | ||
import { EVENT_LOG_CATEGORY, EVENT_LOG_NAME } from '@/constants/eventLog'; | ||
import useCalendar from '@/hooks/useCalendar'; | ||
import { eventLogger } from '@/utils'; | ||
import { css, cx } from '@styled-system/css'; | ||
import dayjs, { type Dayjs } from 'dayjs'; | ||
|
||
interface Props { | ||
selectDate: Dayjs; | ||
setSelectDate: (date: Dayjs) => void; | ||
} | ||
|
||
function MissionCalendar({ selectDate, setSelectDate }: Props) { | ||
const currentData = dayjs(); | ||
|
||
const { date, monthCalendarData, onPrevMonth, onNextMonth, isCurrentMonth } = useCalendar({ | ||
currentData, | ||
isQueryParams: true, | ||
}); | ||
|
||
const currentYear = date.year(); | ||
const currentMonth = date.month() + 1; | ||
|
||
const handlePrevMonth = () => { | ||
eventLogger.logEvent(EVENT_LOG_CATEGORY.RESULT, EVENT_LOG_NAME.RESULT.CLICK_CALENDER_ARROW, { | ||
direction: 'prev', | ||
}); | ||
onPrevMonth(); | ||
}; | ||
|
||
const handleNextMonth = () => { | ||
eventLogger.logEvent(EVENT_LOG_CATEGORY.RESULT, EVENT_LOG_NAME.RESULT.CLICK_CALENDER_ARROW, { | ||
direction: 'next', | ||
}); | ||
onNextMonth(); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<section> | ||
<div className={dateLabeWrapperCss}> | ||
<button type={'button'} className={buttonCss} onClick={handlePrevMonth}> | ||
<Icon name="arrow-back" size={14} /> | ||
</button> | ||
<div className={dateLabelTextCss}> | ||
<span> | ||
{currentYear}년 {currentMonth}월 | ||
</span> | ||
{/* TODO : 나중에 넣어도 되려나 */} | ||
{/* <Icon name={'normal-calender'} size={16} /> */} | ||
</div> | ||
<button | ||
type={'button'} | ||
className={cx(buttonCss, css({ visibility: isCurrentMonth ? 'hidden' : '' }))} | ||
onClick={handleNextMonth} | ||
> | ||
<Icon name="arrow-forward" size={14} /> | ||
</button> | ||
</div> | ||
<table className={tableCss}> | ||
<thead> | ||
<tr className={calendarHeaderCss}> | ||
{WEEK_DAYS.map((day) => ( | ||
<th key={day}>{day}</th> | ||
))} | ||
</tr> | ||
</thead> | ||
<tbody className={calendarBodyCss}> | ||
{monthCalendarData.map((week, i) => ( | ||
<tr key={i}> | ||
{week.map((day, index) => { | ||
if (!day) return <td key={'calender-null-' + index} className={missionCalendarTdCss} />; | ||
|
||
// const isToday = dayjs().isSame(`${day.year}-${day.month}-${day.date}`, 'day'); | ||
const isSelected = selectDate.isSame(`${day.year}-${day.month}-${day.date}`, 'day'); | ||
const thisDay = `${day.year}-${day.month}-${day.date}`; | ||
|
||
return ( | ||
<CalendarItem | ||
key={thisDay} | ||
isSelected={isSelected} | ||
onClick={() => { | ||
setSelectDate(dayjs(thisDay)); | ||
}} | ||
> | ||
{day.date} | ||
</CalendarItem> | ||
); | ||
})} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</section> | ||
<section></section> | ||
</div> | ||
); | ||
} | ||
|
||
export default MissionCalendar; | ||
|
||
const dateLabeWrapperCss = css({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
gap: '12px', | ||
height: '36px', | ||
}); | ||
|
||
const buttonCss = css({ | ||
padding: '8px', | ||
}); | ||
|
||
const tableCss = css({ | ||
width: '100%', | ||
textAlign: 'center', | ||
borderSpacing: '0 8px', | ||
}); | ||
|
||
const dateLabelTextCss = css({ | ||
textStyle: 'subtitle2', | ||
color: 'text.secondary', | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: '4px', | ||
}); | ||
|
||
const missionCalendarTdCss = css({ | ||
padding: ' 12px 0', | ||
}); | ||
|
||
const calendarHeaderCss = css({ | ||
width: '100%', | ||
fontSize: '12px', | ||
fontWeight: '400', | ||
lineHeight: '18px', | ||
color: 'text.secondary', | ||
justifyContent: 'space-between', | ||
height: '40px', | ||
}); | ||
|
||
const calendarBodyCss = css({ | ||
textStyle: 'body6', | ||
color: 'text.tertiary', | ||
}); |
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,72 @@ | ||
import { type PropsWithChildren } from 'react'; | ||
import { css, cx } from '@/styled-system/css'; | ||
|
||
interface Props { | ||
isSelected?: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
function CalendarItem(props: PropsWithChildren<Props>) { | ||
return ( | ||
<td className={cx(itemCss, props.isSelected && selectedCss)} onClick={props.onClick}> | ||
<span | ||
className={cx( | ||
textCss, | ||
css({ | ||
color: props.isSelected ? 'purple.purple700' : 'gray.gray600', | ||
}), | ||
)} | ||
> | ||
{props.children} | ||
</span> | ||
</td> | ||
); | ||
} | ||
|
||
export default CalendarItem; | ||
|
||
const itemCss = css({ | ||
position: 'relative', | ||
textStyle: 'subtitle3', | ||
width: '40px', | ||
height: '40px', | ||
cursor: 'pointer', | ||
|
||
'&::before': { | ||
content: '""', | ||
display: 'block', | ||
position: 'absolute', | ||
top: '50%', | ||
left: '50%', | ||
width: '40px', | ||
height: '40px', | ||
borderRadius: '50%', | ||
border: '1px solid', | ||
borderColor: 'purple.purple700 !', | ||
transform: 'translate(-50%, -50%)', | ||
pointerEvents: 'none', | ||
background: | ||
'linear-gradient(0deg, rgba(0, 0, 0, 0.87), rgba(0, 0, 0, 0.87)), linear-gradient(0deg, #FFFFFF, #FFFFFF)', | ||
zIndex: 0, | ||
|
||
opacity: 0, | ||
transition: 'opacity 0.3s', | ||
}, | ||
}); | ||
|
||
const selectedCss = css({ | ||
'&::before': { | ||
opacity: 1, | ||
}, | ||
}); | ||
|
||
const textCss = css({ | ||
position: 'relative', | ||
zIndex: 1, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
width: '100%', | ||
height: '100%', | ||
transition: 'color 0.3s', | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
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.
굿굿