Skip to content

Commit

Permalink
Merge pull request #251 from STUDIO-EYE/feat/161-Artwork-e2e
Browse files Browse the repository at this point in the history
hotfix: PP artwork detail 수정
  • Loading branch information
40food authored Dec 12, 2024
2 parents 73ca017 + e597c5a commit 499760c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ const ArtworkSequence = ({ type, data, isLoading, error, refetch }: ArtworkSeque
) : onEdit ? (
<DragDropContext onDragEnd={onDragEnd}>
{type === 'main' //main sequence면 top 고정
? realData
?.filter((i) => i.projectType === 'top')
? data?.filter((i) => i.projectType === 'top')
.map((i) => (
<div style={{ marginBottom: '3px' }}>
<ArtworkSequenceBox type={'top'} artworkData={i} />
Expand Down Expand Up @@ -183,8 +182,7 @@ const ArtworkSequence = ({ type, data, isLoading, error, refetch }: ArtworkSeque
<div>
{/*edit 모드 아니면 일반 리스트*/}
{type === 'main' //main sequence면 top 고정
? realData
?.filter((i) => i.projectType === 'top')
? data?.filter((i) => i.projectType === 'top')
.map((i) => (
<div style={{ marginBottom: '3px' }}>
<ArtworkSequenceBox type={'top'} artworkData={i} />
Expand Down
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 499760c

Please sign in to comment.