Skip to content

Commit

Permalink
hotfix: pp artwork detail 이슈 수정
Browse files Browse the repository at this point in the history
- detail에서 새고하면 네비게이션 문제
- detail 이미지 문제
  • Loading branch information
40food committed Dec 12, 2024
1 parent fc2beea commit a94bdba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/PromotionPage/ArtworkDetail/ImageSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function ImageSlider({ projectImages }: IImageSliderProps) {
return (
<div style={{ position: 'relative', width: '100%', height: '100%', overflow: 'hidden' }}>
<AnimatePresence>
{projectImages[index] && projectImages[index].imageUrlList && (
<motion.img
key={projectImages[index].id}
src={projectImages[index].imageUrlList}
Expand All @@ -36,7 +37,7 @@ function ImageSlider({ projectImages }: IImageSliderProps) {
transition={{ duration: 1 }}
style={{ position: 'absolute', width: '100%', height: '100%', objectFit: 'cover' }}
alt=''
/>
/>)}
</AnimatePresence>
<div style={{ position: 'absolute', bottom: '20px', width: '100%', textAlign: 'center' }}>
{projectImages.map((_, pageIndex) => (
Expand Down
7 changes: 3 additions & 4 deletions src/pages/PromotionPage/ArtworkPage/ArtworkDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ function ArtworkDetailPage() {
const { data, isLoading } = useQuery<IArtworksData>(['artwork', 'id'], getArtworkData);
const [filteredData,setFilteredData]=useState<IArtwork[]>([])

const clickedArtwork =
artworkDetailMatch?.params.id && data?.data.find((artwork) => String(artwork.id) === artworkDetailMatch.params.id);
useEffect(()=>{
const clickedArtwork = artworkDetailMatch?.params.id && data?.data.find((artwork) => String(artwork.id) === artworkDetailMatch.params.id);
useEffect(()=>{
if(data){
if(artworkDetailMatch?.params.category!=="all"){
setFilteredData(data.data.filter((d)=>{return d.category===artworkDetailMatch?.params.category! && d.isPosted===true}))
Expand All @@ -34,7 +33,7 @@ function ArtworkDetailPage() {
setFilteredData(data.data.filter((d)=>{return d.isPosted===true}))
}
}
},[])
},[data, artworkDetailMatch?.params.category])

// animation
const { scrollYProgress } = useScroll();
Expand Down

0 comments on commit a94bdba

Please sign in to comment.