Skip to content

Commit ee382a2

Browse files
Merge pull request #121 from dnd-side-project/refactor/#120/cd-crud
2 parents ce46506 + 594fe0a commit ee382a2

File tree

17 files changed

+95
-99
lines changed

17 files changed

+95
-99
lines changed

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ const LogoContainer = styled.div`
304304
gap: 17px;
305305
& > img:first-child {
306306
width: 186px;
307-
height: 45px;
308307
}
309308
& > p {
310309
font-size: 46px;

src/entities/playlist/model/useMyCd.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const useMyCdList = (sort: string) => {
1313
queryKey: ['myCdList', sort],
1414
queryFn: () => getMyCdList(sort),
1515
refetchOnMount: 'always',
16+
placeholderData: undefined, // 이전 데이터 즉시 제거
1617
})
1718
}
1819

@@ -21,6 +22,7 @@ export const useMyLikedCdList = (sort: string) => {
2122
queryKey: ['myLikeList', sort],
2223
queryFn: () => getLikedCdList(sort),
2324
refetchOnMount: 'always',
25+
placeholderData: undefined,
2426
})
2527
}
2628

@@ -31,6 +33,7 @@ export const useMyCdActions = (cdId: number, options?: { enabled?: boolean }) =>
3133
const {
3234
data: tracklist,
3335
isLoading,
36+
isFetching,
3437
isError,
3538
} = useQuery({
3639
queryKey: ['getTracklist', cdId],
@@ -57,6 +60,7 @@ export const useMyCdActions = (cdId: number, options?: { enabled?: boolean }) =>
5760
return {
5861
tracklist,
5962
isLoading,
63+
isFetching,
6064
isError,
6165
deleteMutation,
6266
togglePublicMutation,

src/pages/mycd/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ const MyCdPage = () => {
198198
size="S"
199199
state="primary"
200200
onClick={() =>
201-
navigate(`/mypage/customize?playlistId=${currentPlaylist?.playlistId}`)
201+
navigate(`/mypage/customize`, {
202+
state: { cdId: currentPlaylist?.playlistId },
203+
})
202204
}
203205
>
204206
편집

src/pages/mypage/mock/likeUser.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/pages/mypage/mock/myPlaylist.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/pages/mypage/mock/playlistLinks.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/pages/mypage/ui/customize/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ const Customize = () => {
4848
const {
4949
tracklist: prevTracklist,
5050
isLoading,
51+
isFetching,
5152
isError,
5253
} = useMyCdActions(isEditMode ? Number(cdId) : -1)
5354

54-
if (isLoading) return <Loading isLoading={isLoading} />
55+
if (isLoading || isFetching) return <Loading isLoading={isLoading || isFetching} />
5556
if (isError) {
5657
navigate('/error')
5758
return null

src/pages/mypage/ui/customize/step1/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,14 @@ const GenreDropdown = styled.button<{ $isSelected: boolean }>`
397397
display: flex;
398398
align-items: center;
399399
justify-content: space-between;
400-
padding: 14px 11px;
400+
padding: 16px 12px;
401401
width: 100%;
402402
height: 42px;
403403
border-radius: 10px;
404404
color: ${({ theme, $isSelected }) =>
405405
$isSelected ? theme.COLOR['gray-10'] : theme.COLOR['gray-300']};
406-
background-color: ${({ theme }) => theme.COLOR['gray-800']};
406+
background-color: ${({ theme }) => theme.COLOR['gray-700']};
407+
${({ theme }) => theme.FONT['body2-normal']}
407408
`
408409

409410
const EachGenre = styled.button<{ $currentGenre: boolean }>`

src/pages/mypage/ui/customize/step2/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type {
2323
import { THEME_PROP_ID_OFFSET } from '@/pages/mypage/types/mypage'
2424
import { StepHeader } from '@/pages/mypage/ui/components'
2525
import type { CustomizeStepProps } from '@/pages/mypage/ui/customize'
26+
import { useDragScroll } from '@/shared/lib/useDragScroll'
2627
import { flexRowCenter } from '@/shared/styles/mixins'
2728
import { Loading } from '@/shared/ui'
2829
import type { ModalProps } from '@/shared/ui/Modal'
@@ -40,6 +41,7 @@ const CustomizeStep2 = ({
4041
const fileInputRef = useRef<HTMLInputElement>(null)
4142
const cdContainerRef = useRef<HTMLCanvasElement>(null)
4243
const imageCache = useRef<{ [key: string]: HTMLImageElement | null }>({})
44+
const themeListRef = useRef<HTMLUListElement>(null)
4345

4446
const [currentThemeId, setCurrentThemeId] = useState<StickerThemeType>('deulak')
4547
const [stickers, setStickers] = useState<StickerInfoType[]>([])
@@ -51,6 +53,8 @@ const CustomizeStep2 = ({
5153
const { uploadSticker, uploadLoading } = useUserSticker()
5254
const { createMutation, updateMutation } = useCdFinalSave()
5355

56+
useDragScroll(themeListRef as React.RefObject<HTMLElement>)
57+
5458
// ===============================
5559
// 스티커 초기 데이터 세팅
5660
// ===============================
@@ -934,7 +938,7 @@ const CustomizeStep2 = ({
934938
</AllDeleteBtn>
935939
</CdAreaWrap>
936940
<StickerAreaWrap>
937-
<ThemeListContainer>
941+
<ThemeListContainer ref={themeListRef}>
938942
{STICKER_THEME_LIST.map((theme) => (
939943
<li key={theme.id}>
940944
<ThemeButton

src/pages/mypage/ui/customize/step3/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ const CtaButton = styled.button`
122122
background-color: ${({ theme }) => theme.COLOR['primary-normal']};
123123
border-radius: 20px;
124124
color: ${({ theme }) => theme.COLOR['gray-900']};
125-
${({ theme }) => theme.FONT['label']}
125+
${({ theme }) => theme.FONT['body2-normal']}
126126
`

0 commit comments

Comments
 (0)