-
-
- {isFetchingNextPage &&
로딩중...
}
+
+ {/* 어두운 오버레이 */}
+
+
+ {/* 상단 흰색 그라디언트 */}
+
+
+
+
+
+
+ {isFetchingNextPage &&
로딩중...
}
+
+
)
-}
\ No newline at end of file
+}
diff --git a/Mine/src/pages/magazine/SavedMagazinePage.tsx b/Mine/src/pages/magazine/SavedMagazinePage.tsx
index 21d5195..baaf1de 100644
--- a/Mine/src/pages/magazine/SavedMagazinePage.tsx
+++ b/Mine/src/pages/magazine/SavedMagazinePage.tsx
@@ -2,65 +2,76 @@ import { useState } from 'react'
import SavedMagazineItem from './components/SavedMagazineItem'
import ArrowPagination from './components/ArrowPagination'
import useGetLikedMagazineList from '../../hooks/useGetLikedMagazineList'
+import savedbg from '../../assets/savedbg.jpg'
const CARD_WIDTH = 476
const GAP = 16
-const COLUMN_STEP = CARD_WIDTH + GAP
+const COLUMNS_PER_VIEW = 2
+const COLUMN_STEP = (CARD_WIDTH + GAP) * COLUMNS_PER_VIEW
const ITEMS_PER_COLUMN = 2
export default function SavedMagazinePage() {
- const [columnIndex, setColumnIndex] = useState(0)
+ const [columnIndex, setColumnIndex] = useState(0)
- const { data, isLoading, isError } = useGetLikedMagazineList({
- page: 0,
- size: 20,
- sort: ['createdAt,desc'],
- })
+ const { data, isLoading, isError } = useGetLikedMagazineList({
+ page: 0,
+ size: 20,
+ sort: ['createdAt,desc'],
+ })
- if (isLoading) return
로딩중...
- if (isError) return
불러오기 실패
+ if (isLoading) return
로딩중...
+ if (isError) return
불러오기 실패
- const magazines = data?.content ?? []
+ const magazines = data?.content ?? []
- if (magazines.length === 0) {
- return
찜한 매거진이 아직 없어요.
- }
+ if (magazines.length === 0) {
+ return
찜한 매거진이 아직 없어요.
+ }
- const columns = Array.from({ length: Math.ceil(magazines.length / ITEMS_PER_COLUMN) }, (_, i) =>
- magazines.slice(i * ITEMS_PER_COLUMN, i * ITEMS_PER_COLUMN + ITEMS_PER_COLUMN),
- )
+ const columns = Array.from({ length: Math.ceil(magazines.length / ITEMS_PER_COLUMN) }, (_, i) =>
+ magazines.slice(i * ITEMS_PER_COLUMN, i * ITEMS_PER_COLUMN + ITEMS_PER_COLUMN)
+ )
- const TOTAL_COLUMNS = columns.length
+ const TOTAL_COLUMNS = columns.length
+ const TOTAL_PAGES = Math.ceil(TOTAL_COLUMNS / COLUMNS_PER_VIEW)
- return (
-
-
-
-
+ return (
+
+
-
-
- {columns.map((col, colIdx) => (
-
- {col.map((magazine) => (
-
- ))}
+
+
+
+
+ {columns.map((col, colIdx) => (
+
+ {col.map((magazine) => (
+
+ ))}
+
+ ))}
+
+
- ))}
+
+
+ setColumnIndex((prev) => Math.min(prev + 1, TOTAL_PAGES * COLUMNS_PER_VIEW - COLUMNS_PER_VIEW))
+ }
+ onPrev={() => setColumnIndex((prev) => Math.max(prev - 1, 0))}
+ />
-
-
-
setColumnIndex((prev) => Math.min(prev + 1, TOTAL_COLUMNS - 1))}
- onPrev={() => setColumnIndex((prev) => Math.max(prev - 1, 0))}
- />
-
-
- )
-}
\ No newline at end of file
+ )
+}
diff --git a/Mine/src/pages/magazine/components/ExploreGrid.tsx b/Mine/src/pages/magazine/components/ExploreGrid.tsx
index 9cb5603..d171378 100644
--- a/Mine/src/pages/magazine/components/ExploreGrid.tsx
+++ b/Mine/src/pages/magazine/components/ExploreGrid.tsx
@@ -7,7 +7,13 @@ interface ExploreGridProps {
export default function ExploreGrid({ magazines }: ExploreGridProps) {
return (
-
+
{magazines.map((magazine) => (
))}
diff --git a/Mine/src/pages/magazine/components/ExploreItem.tsx b/Mine/src/pages/magazine/components/ExploreItem.tsx
index c786cb4..0f6fa10 100644
--- a/Mine/src/pages/magazine/components/ExploreItem.tsx
+++ b/Mine/src/pages/magazine/components/ExploreItem.tsx
@@ -12,18 +12,14 @@ export default function ExploreItem({ magazine }: Props) {
return (
navigate(`/magazine/${magazine.magazineId}`)}
>
-
- {magazine.title}
-
+
{magazine.title}
)
-}
\ No newline at end of file
+}
diff --git a/Mine/src/pages/magazine/components/SavedMagazineItem.tsx b/Mine/src/pages/magazine/components/SavedMagazineItem.tsx
index 874158c..04c5848 100644
--- a/Mine/src/pages/magazine/components/SavedMagazineItem.tsx
+++ b/Mine/src/pages/magazine/components/SavedMagazineItem.tsx
@@ -2,35 +2,33 @@ import { useNavigate } from 'react-router-dom'
import type { Magazine } from '../../../types/magazine'
type Props = {
- magazine: Magazine
+ magazine: Magazine
}
const isValidUrl = (url: string) => {
- try {
- const parsed = new URL(url)
- return parsed.protocol === 'https:'
- } catch {
- return false
- }
+ try {
+ const parsed = new URL(url)
+ return parsed.protocol === 'https:'
+ } catch {
+ return false
+ }
}
export default function SavedMagazineItem({ magazine }: Props) {
- const navigate = useNavigate()
- const safeImageUrl = isValidUrl(magazine.coverImageUrl) ? magazine.coverImageUrl : ''
+ const navigate = useNavigate()
+ const safeImageUrl = isValidUrl(magazine.coverImageUrl) ? magazine.coverImageUrl : ''
- return (
-
navigate(`/magazine/${magazine.magazineId}`)}
- >
-
- {magazine.title}
-
-
- )
-}
\ No newline at end of file
+ return (
+
navigate(`/magazine/${magazine.magazineId}`)}
+ >
+
+ {magazine.title}
+
+
+ )
+}
diff --git a/Mine/src/pages/main/GuestPage.tsx b/Mine/src/pages/main/GuestPage.tsx
index 0e74d61..126b8ae 100644
--- a/Mine/src/pages/main/GuestPage.tsx
+++ b/Mine/src/pages/main/GuestPage.tsx
@@ -27,12 +27,8 @@ export default function GuestPage() {
return (