Skip to content

Commit bbd2eae

Browse files
authored
Merge pull request #308 from vsgg12/dev
Deploy: pc/모바일 버전 피드백 배너 퍼블리싱 추가
2 parents d56b267 + 26a1a59 commit bbd2eae

14 files changed

Lines changed: 216 additions & 59 deletions

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"react-js-pagination": "^3.0.2",
4040
"react-quill": "^2.0.0",
4141
"react-responsive": "^10.0.0",
42+
"swiper": "^11.2.6",
4243
"zustand": "^4.5.2"
4344
},
4445
"devDependencies": {
115 KB
Loading
130 KB
Loading

public/svg/banner/banner.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.

public/svg/banner/bannerMobile.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/app/globals.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,20 @@ button {
234234
transform: rotate(1turn);
235235
}
236236
}
237+
238+
.custom-pagination {
239+
display: flex;
240+
gap: 8px;
241+
z-index: 100;
242+
cursor: pointer;
243+
--swiper-pagination-bullet-vertical-gap: 0px;
244+
}
245+
246+
.custom-pagination .swiper-pagination-bullet {
247+
background-color: #999999;
248+
width: 5px;
249+
height: 5px;
250+
}
251+
.custom-pagination .swiper-pagination-bullet-active {
252+
background-color: #8a1f21;
253+
}

src/app/home/_component/HomePostItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function HomePostItems({
6060
}}
6161
>
6262
<div className='flex w-full font-medium justify-center items-center gap-[8px]'>
63-
<div className='h-[40px] text-black text-[1.563rem] '>{post.title}</div>
63+
<div className='max-w-[70%] text-black text-[1.563rem] '>{post.title}</div>
6464
<p className='text-[#C8C8C8] flex-grow text-[0.75rem]'>
6565
| 조회수 {formatNumberWithCommas(post.viewCount)}
6666
</p>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use client';
2+
import React from 'react';
3+
import { Swiper, SwiperSlide } from 'swiper/react';
4+
import { Pagination, Autoplay } from 'swiper/modules';
5+
6+
import 'swiper/css';
7+
import 'swiper/css/pagination';
8+
import { useRouter } from 'next/navigation';
9+
10+
function HorizontalBannerSwiper() {
11+
const router = useRouter();
12+
const handleFeedbackBannerClick = () => {
13+
router.push('https://forms.gle/RN9FPwW6UgrExoTo8');
14+
};
15+
const handleUploadBannerClick = () => {
16+
router.push('https://forms.gle/gFMtaNWqMZN7oqJW7');
17+
};
18+
19+
return (
20+
<div className='w-full flex flex-col gap-[10px]'>
21+
<Swiper
22+
modules={[Autoplay, Pagination]}
23+
spaceBetween={30}
24+
pagination={{
25+
clickable: true,
26+
el: '.custom-pagination',
27+
}}
28+
autoplay={{
29+
delay: 3000,
30+
disableOnInteraction: false,
31+
}}
32+
loop={true}
33+
className='w-[304px] h-[134.89px] flex'
34+
>
35+
<SwiperSlide>
36+
<img
37+
src='/images/banner/VSGG배너_피드백시RP증정.png'
38+
alt='피드백배너'
39+
className='w-full h-full cursor-pointer'
40+
onClick={handleFeedbackBannerClick}
41+
/>
42+
</SwiperSlide>
43+
<SwiperSlide>
44+
<img
45+
src='/images/banner/VSGG배너_영상업로드시RP증정.png'
46+
alt='영상업로드배너'
47+
className='w-full h-full cursor-pointer'
48+
onClick={handleUploadBannerClick}
49+
/>
50+
</SwiperSlide>
51+
</Swiper>
52+
<div className='custom-pagination flex justify-end'></div>
53+
</div>
54+
);
55+
}
56+
57+
export default HorizontalBannerSwiper;

src/app/home/_component/Search.tsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
'use client'
12
import { GoSearch } from 'react-icons/go';
23
import Logo from '../../../components/Logo';
34
import useSearchStore from '../store/useSearchStore';
45
import { useState } from 'react';
5-
// import Image from 'next/image';
6-
// import Banner from '../../../../public/svg/banner/banner.svg';
7-
// import { useRouter } from 'next/navigation';
6+
import HorizontalBannerSwiper from './HorizontalBannerSwiper';
87

98
export default function Search({
109
handleSearch,
@@ -15,18 +14,13 @@ export default function Search({
1514
}) {
1615
const { setKeyword } = useSearchStore();
1716
const [searchKeyword, setSearchKeyword] = useState<string>('');
18-
// const router = useRouter();
1917

2018
const handleKeywordChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2119
const trimmedKeyword = e.target.value.trim();
2220
setKeyword(trimmedKeyword);
2321
setSearchKeyword(e.target.value);
2422
};
2523

26-
// const handleFeedbackBannerClick = () => {
27-
// router.push('https://forms.gle/iszzzg32YAeSLJPq9');
28-
// };
29-
3024
return (
3125
<div className='flex w-full justify-center relative'>
3226
<div className='mb-[100px] mt-[100px] flex flex-col items-center justify-center gap-[32px]'>
@@ -40,18 +34,13 @@ export default function Search({
4034
value={searchKeyword}
4135
/>
4236
<button onClick={handleSearch}>
43-
<GoSearch className='absolute right-5 top-2.5 text-[#8A1F21]' />
37+
<GoSearch className='absolute right-5 top-2.5 text-[#8A1F21]' />
4438
</button>
4539
</div>
4640
</div>
47-
{/* <Image
48-
src={Banner}
49-
alt='feedback banner'
50-
width={284}
51-
height={112}
52-
className='absolute right-0 top-[20%] translate-y-[-50%] cursor-pointer'
53-
onClick={handleFeedbackBannerClick}
54-
/> */}
41+
<div className='absolute right-0 top-1/2 -translate-y-1/2'>
42+
<HorizontalBannerSwiper />
43+
</div>
5544
</div>
5645
);
5746
}

0 commit comments

Comments
 (0)