Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b77781d
fix: 코인토스 포인트 배팅시 서버가 느리다면 앞면 뒷면이 disabeld가 되지 않아 선택이 되는 문제 해결
Ethen1264 Apr 28, 2025
698bcec
fix: 값이 변경되거나 상위 컴포넌트가 리렌더링 될때 영상이 사라지는 문제 해결
Ethen1264 Apr 28, 2025
393a1d4
refector: coin-toss page
Ethen1264 Apr 28, 2025
f28fb3b
refector: 코인토스 애니매이션 코드 리팩토링
Ethen1264 Apr 28, 2025
96bfc2a
refector: YavarweePage 동작별로 분리
Ethen1264 Apr 28, 2025
5236181
refector: 야바위 애니매이션 코드 분리
Ethen1264 Apr 28, 2025
e1b2f0e
chore: 주석 제거
Ethen1264 Apr 28, 2025
5934b6a
refector: 컵 셔플 방식 기존의 방식으로 적용
Ethen1264 Apr 29, 2025
52fa00b
Merge branch 'develop' of https://github.com/team-gogo/GOGO-Frontend …
Ethen1264 Apr 29, 2025
6d3881f
fix: stage 옮길때 포인트 값 변하지 않는 이슈
gjaegyun Apr 29, 2025
5dce94f
fix: end 된 게임 후순위 배치
gjaegyun Apr 30, 2025
d4681e1
fix: isPending 상태에 따른 storage 값 삭제
gjaegyun Apr 30, 2025
9f8cbe3
Merge pull request #224 from team-gogo/fix/couponStorage
gjaegyun Apr 30, 2025
a883ac6
fix: detail match page의 date container 적용
gjaegyun Apr 30, 2025
d10766d
Merge pull request #227 from team-gogo/fix/detailMatch
gjaegyun May 1, 2025
3925fc7
Merge branch 'develop' into fix/stageMovePointIssue
gjaegyun May 1, 2025
831bdb9
Merge pull request #223 from team-gogo/fix/stageMovePointIssue
gjaegyun May 1, 2025
e49d8eb
Merge branch 'develop' into fix/matchEndSort
gjaegyun May 1, 2025
a75b0cf
Merge pull request #225 from team-gogo/fix/matchEndSort
gjaegyun May 1, 2025
a9fbc66
Merge branch 'develop' of https://github.com/team-gogo/GOGO-Frontend …
Ethen1264 May 1, 2025
d20727f
Merge pull request #221 from team-gogo/chore/mini-game
Ethen1264 May 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 29 additions & 31 deletions src/entities/main/ui/DateContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DateContainer = () => {
}, []);
const pastDays = Math.floor(totalDays / 2);

const { setSelectDate } = useSelectDateStore();
const { selectDate, setSelectDate } = useSelectDateStore();

const { stageId } = useMyStageIdStore();

Expand All @@ -42,39 +42,37 @@ const DateContainer = () => {
return { short: `${month}-${day}`, full: `${year}-${month}-${day}` };
});

const syncSelectedDate = (fullDate: string) => {
const matchedDate = dates.find((d) => d.full === fullDate);

if (matchedDate) {
setSelectedDate(matchedDate.short);
setSelectDate(matchedDate.full);
setStartIndex(dates.findIndex((d) => d.full === fullDate));
} else {
const date = new Date(fullDate);
const short = `${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
setSelectedDate(short);
setSelectDate(fullDate);
setStartIndex(dates.findIndex((d) => d.full === fullDate));
}
};

useEffect(() => {
const localSelectDate = sessionStorage.getItem('selectDate');

if (localSelectDate) {
const { selectDate: localDate, stageId: localStageId } =
JSON.parse(localSelectDate);

if (localDate !== '') {
if (stageId === localStageId) {
const matchedDate = dates.find((d) => d.full === localDate);

if (matchedDate) {
setSelectedDate(matchedDate.short);
setSelectDate(matchedDate.full);
const matchedIndex = dates.findIndex((d) => d.full === localDate);
setStartIndex(matchedIndex);
} else {
const date = new Date(localDate);
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const short = `${month}-${day}`;

setSelectedDate(short);
setSelectDate(localDate);
const matchedIndex = dates.findIndex((d) => d.full === localDate);
setStartIndex(matchedIndex);
}
}
}
if (selectDate) syncSelectedDate(selectDate);
}, []);

useEffect(() => {
const local = sessionStorage.getItem('selectDate');
if (!local) return;

const { selectDate: localDate, stageId: localStageId } = JSON.parse(local);
sessionStorage.removeItem('selectDate');

sessionStorage.removeItem('selectDate');
if (localDate && stageId === localStageId) {
syncSelectedDate(localDate);
}
}, [dates]);
}, [dates, stageId]);

const todayIndex = dates.findIndex(
(d) =>
Expand Down
14 changes: 9 additions & 5 deletions src/shared/ui/stageMatchContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ const StageMatchContainer = ({

{matches?.matches
.slice()
.sort(
(a, b) =>
new Date(a.startDate).getTime() -
new Date(b.startDate).getTime(),
)
.sort((a, b) => {
if (a.isEnd === b.isEnd) {
return (
new Date(a.startDate).getTime() -
new Date(b.startDate).getTime()
);
}
return a.isEnd ? 1 : -1;
})
.map((match) => (
<div
key={match.matchId}
Expand Down
12 changes: 10 additions & 2 deletions src/views/coupon/ui/CouponPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { usePostMyCoupon } from '../../model/usePostMyCoupon';
const CouponPage = () => {
const searchParams = useSearchParams();
const couponId = searchParams.get('couponId');
const { data: couponInfo } = useGetMyCouponInfo(String(couponId));
const { data: couponInfo, isPending } = useGetMyCouponInfo(String(couponId), {
enabled: !!couponId,
retry: false,
});
const { mutate: postCoupon, data: couponData } = usePostMyCoupon(
String(couponId),
);
Expand All @@ -36,10 +39,15 @@ const CouponPage = () => {
useEffect(() => {
if (couponInfo) {
setIsUseCoupon(couponInfo.isUsed);
localStorage.removeItem('couponId');
}
}, [couponInfo]);

useEffect(() => {
if (!isPending) {
localStorage.removeItem('couponId');
}
}, [isPending]);

useEffect(() => {
if (couponData) {
setIsGain(couponData.isGain);
Expand Down
5 changes: 3 additions & 2 deletions src/views/main/ui/MainPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const MainPage = () => {
포인트
</h2>
<h2 className={cn('laptop:text-h3e', 'text-body1e', 'text-white')}>
{formatPoint(point)}
{userPointData ? formatPoint(point) : '000'}
</h2>
<h3
className={cn(
Expand All @@ -164,7 +164,7 @@ const MainPage = () => {
'hidden',
)}
>
({point.toLocaleString()})
{userPointData ? `(${point.toLocaleString()})` : '(000)'}
</h3>
</div>
<DateContainer />
Expand All @@ -174,6 +174,7 @@ const MainPage = () => {
text={isToday ? '오늘 최신 매치' : `${selectDate.slice(5)} 매치`}
icon={<MatchClockIcon />}
path={`/match/list/${stageId}`}
onClick={() => setSelectDate(selectDate)}
>
<StageMatchSection
matches={searchMatchData}
Expand Down
4 changes: 4 additions & 0 deletions src/views/match/ui/MatchPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const MatchPage = () => {
setSelectDate('');
}, [stageId]);

useEffect(() => {
setSelectDate(selectDate);
}, []);

const today = new Date();

const [year, month, day] = selectDate
Expand Down