Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

모임 피드 쪽 광고 구좌 amplitude 추가 #850

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions src/components/page/meetingList/Advertisement/AdCarousel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useMemo } from 'react';
import React, { useCallback, useEffect, useMemo } from 'react';
import { EmblaOptionsType, EmblaCarouselType } from 'embla-carousel';
import { DotButton, useDotButton } from './AdCarouselDotBtn';
import { PrevButton, NextButton, usePrevNextButtons } from './AdCarouselArrowBtn';
Expand Down Expand Up @@ -52,29 +52,38 @@ const AdCarousel: React.FC<PropType> = props => {

const { data: me } = useQueryMyProfile();

useEffect(() => {}, []);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

근데 혹시 이건 왜 추가해놓은건가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 지운다는 걸 깜빡했네요! 노티 감사합니당 :)

return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Embla>
<EmblaViewport ref={emblaRef}>
<EmblaContainer>
{shuffledSlides?.map((slide, index) => (
<Link
href={slide?.advertisementLink}
target="_blank"
onClick={() =>
ampli.clickBanner({
banner_id: slide.advertisementId,
banner_url: slide.advertisementLink,
banner_timestamp: slide.advertisementStartDate,
user_id: Number(me?.orgId),
})
}
>
<EmblaSlide key={index}>
<EmblaSlideImage src={slide?.mobileImageUrl}></EmblaSlideImage>
</EmblaSlide>
</Link>
))}
{shuffledSlides?.map((slide, index) => {
ampli.impressionBanner({
banner_id: slide.advertisementId,
banner_url: slide.advertisementLink,
banner_timestamp: slide.advertisementStartDate,
});
return (
<Link
href={slide?.advertisementLink}
target="_blank"
onClick={() =>
ampli.clickBanner({
banner_id: slide.advertisementId,
banner_url: slide.advertisementLink,
banner_timestamp: slide.advertisementStartDate,
user_id: Number(me?.orgId),
})
}
>
<EmblaSlide key={index}>
<EmblaSlideImage src={slide?.mobileImageUrl}></EmblaSlideImage>
</EmblaSlide>
</Link>
);
})}
</EmblaContainer>
</EmblaViewport>

Expand Down
Loading