diff --git a/Mine/src/assets/explorebg.jpg b/Mine/src/assets/explorebg.jpg new file mode 100644 index 0000000..dfcf9bd Binary files /dev/null and b/Mine/src/assets/explorebg.jpg differ diff --git a/Mine/src/assets/savedbg.jpg b/Mine/src/assets/savedbg.jpg new file mode 100644 index 0000000..7b0796d Binary files /dev/null and b/Mine/src/assets/savedbg.jpg differ diff --git a/Mine/src/components/settings/ScreenSettings.tsx b/Mine/src/components/settings/ScreenSettings.tsx index ba58af6..f3a162b 100644 --- a/Mine/src/components/settings/ScreenSettings.tsx +++ b/Mine/src/components/settings/ScreenSettings.tsx @@ -1,4 +1,4 @@ -import { useState, useRef } from 'react' +import { useState, useRef, useEffect } from 'react' import { useParams } from 'react-router-dom' import IconWandStars from '../../icon/wand_stars.svg?react' import IconAddPhoto from '../../icon/add_photo_alternate.svg?react' @@ -29,7 +29,6 @@ export default function ScreenSettings() { const { imageUrl } = await uploadImage(file) await patchCover({ id: Number(magazineId), coverImageUrl: imageUrl }) setShowToast(true) - setTimeout(() => setShowToast(false), 3000) } catch (error) { console.error('이미지 업로드 실패:', error) } @@ -42,7 +41,6 @@ export default function ScreenSettings() { await createMoodboard(Number(magazineId)) setIsConfirmOpen(false) setShowToast(true) - setTimeout(() => setShowToast(false), 3000) } catch (error) { console.error('무드보드 생성 실패:', error) } finally { @@ -50,6 +48,15 @@ export default function ScreenSettings() { } } + useEffect(() => { + if (showToast) { + const timerId = setTimeout(() => { + setShowToast(false) + }, 3000) + return () => clearTimeout(timerId) + } + }, [showToast]) + return ( <>
@@ -88,4 +95,4 @@ export default function ScreenSettings() { )} ) -} \ No newline at end of file +} diff --git a/Mine/src/pages/landing/LandingPage.tsx b/Mine/src/pages/landing/LandingPage.tsx index ce5a662..f9eb217 100644 --- a/Mine/src/pages/landing/LandingPage.tsx +++ b/Mine/src/pages/landing/LandingPage.tsx @@ -12,12 +12,8 @@ export default function LandingPage() { return (
diff --git a/Mine/src/pages/magazine/ExplorePage.tsx b/Mine/src/pages/magazine/ExplorePage.tsx index 3cf53dc..7d54b9b 100644 --- a/Mine/src/pages/magazine/ExplorePage.tsx +++ b/Mine/src/pages/magazine/ExplorePage.tsx @@ -1,8 +1,11 @@ import { useEffect, useRef } from 'react' import ExploreGrid from './components/ExploreGrid' import useGetMagazineFeed from '../../hooks/useGetMagazineFeed' +import explorebg from '../../assets/explorebg.jpg' +import useSidebarStore from '../../stores/sidebar' export default function ExplorePage() { + const { isOpen } = useSidebarStore() const { data, fetchNextPage, hasNextPage, isFetchingNextPage } = useGetMagazineFeed() const observerRef = useRef(null) @@ -23,10 +26,33 @@ export default function ExplorePage() { }, [hasNextPage, isFetchingNextPage, fetchNextPage]) return ( -
- -
- {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 (