11'use client' ;
22
33import Image from 'next/image' ;
4+ import Link from 'next/link' ;
45
56import {
67 bannerCarousel ,
@@ -14,32 +15,38 @@ import { useSlide } from './hooks/useSlide';
1415import { useTouchSlide } from './hooks/useTouchSlide' ;
1516import { SLIDE_SPEED } from '../../home.constants' ;
1617
17- import MobileBanner from '@/assets/images/mobileBanner .webp' ;
18- import MobileBannerSecond from '@/assets/images/mobileBanner2 .webp' ;
19- import WebBanner from '@/assets/images/webBanner.png ' ;
20- import WebBannerSecond from '@/assets/images/webBanner2.png ' ;
18+ import MobileBanner from '@/assets/images/mobileSurveyBanner .webp' ;
19+ import MobileBannerSecond from '@/assets/images/mobileSurveyBanner .webp' ;
20+ import WebBanner from '@/assets/images/webSurveyBanner.webp ' ;
21+ import WebBannerSecond from '@/assets/images/webSurveyBanner.webp ' ;
2122import Icon from '@/components/Icon' ;
2223
24+ const SURVEY_URL = 'https://gradmeet.co.kr/post/0NF84Z489GFJE?utm_source=banner' ;
25+
2326const BannerMap = [
2427 {
2528 webSrc : WebBanner ,
2629 mobileSrc : MobileBanner ,
2730 alt : '참여자 언제 다 모을지 고민이라면 공고를 올리고 가까운 참여자에게 실험을 알려보세요' ,
31+ url : SURVEY_URL ,
2832 } ,
2933 {
3034 webSrc : WebBannerSecond ,
3135 mobileSrc : MobileBannerSecond ,
3236 alt : '공강 시간에 부담 없이 용돈 버는 방법 학교 근처 실험에 참여하고 보상을 받아보세요' ,
37+ url : SURVEY_URL ,
3338 } ,
3439 {
3540 webSrc : WebBanner ,
3641 mobileSrc : MobileBanner ,
3742 alt : '참여자 언제 다 모을지 고민이라면 공고를 올리고 가까운 참여자에게 실험을 알려보세요' ,
43+ url : SURVEY_URL ,
3844 } ,
3945 {
4046 webSrc : WebBannerSecond ,
4147 mobileSrc : MobileBannerSecond ,
4248 alt : '공강 시간에 부담 없이 용돈 버는 방법 학교 근처 실험에 참여하고 보상을 받아보세요' ,
49+ url : SURVEY_URL ,
4350 } ,
4451] ;
4552
@@ -68,9 +75,8 @@ const Banner = () => {
6875 transition : `transform ${ SLIDE_SPEED } s ease-in-out` ,
6976 } }
7077 >
71- { BannerMap . map ( ( banner , idx ) => (
72- < picture key = { idx } style = { { display : 'block' , flex : '0 0 100%' } } >
73- < source media = "(max-width: 767px)" srcSet = { banner . mobileSrc . src } />
78+ { BannerMap . map ( ( banner , idx ) => {
79+ const imageContent = (
7480 < Image
7581 key = { idx }
7682 src = { banner . webSrc }
@@ -80,8 +86,15 @@ const Banner = () => {
8086 width = { 1000 }
8187 height = { 80 }
8288 />
83- </ picture >
84- ) ) }
89+ ) ;
90+
91+ return (
92+ < picture key = { idx } style = { { display : 'block' , flex : '0 0 100%' } } >
93+ < source media = "(max-width: 767px)" srcSet = { banner . mobileSrc . src } />
94+ { banner . url ? < Link href = { banner . url } > { imageContent } </ Link > : imageContent }
95+ </ picture >
96+ ) ;
97+ } ) }
8598 </ div >
8699 </ div >
87100
0 commit comments