-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
244 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, { ReactNode } from 'react' | ||
|
||
interface CommunityLayoutProps { | ||
children: React.ReactNode | ||
} | ||
|
||
const CommunityLayout = ({ children }: CommunityLayoutProps): ReactNode => { | ||
return <div className='mt-24'>{children}</div> | ||
} | ||
|
||
export default CommunityLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { ReactNode } from 'react' | ||
|
||
import PlaceBanner from '@/components/community/place/PlaceBanner' | ||
import PlaceFilter from '@/components/community/place/PlaceFilter' | ||
import PopularPlace from '@/components/community/place/PopularPlace' | ||
|
||
interface CommunityPlacePageProps {} | ||
|
||
const CommunityPlacePage = ({}: CommunityPlacePageProps): ReactNode => { | ||
return ( | ||
<div className='flex h-screen w-full justify-center'> | ||
<div className='flex h-screen w-[80%] flex-col'> | ||
<PlaceBanner /> | ||
<PopularPlace /> | ||
<PlaceFilter /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default CommunityPlacePage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React, { ReactNode } from 'react' | ||
|
||
interface CommunityPlanPageProps {} | ||
|
||
const CommunityPlanPage = ({}: CommunityPlanPageProps): ReactNode => { | ||
return <div>CommunityPlanPage</div> | ||
} | ||
|
||
export default CommunityPlanPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Image from 'next/image' | ||
import React, { ReactNode } from 'react' | ||
|
||
import BusanImg from '@/public/images/busan.jpg' | ||
|
||
interface PlaceBannerProps {} | ||
|
||
const PlaceBanner = ({}: PlaceBannerProps): ReactNode => { | ||
return ( | ||
<> | ||
<p className='my-5'>{`홈 > 커뮤니티 > 여행지`}</p> | ||
<div className='flex gap-20'> | ||
<Image src={BusanImg} alt='BusanImg' height={400} className='rounded-md' /> | ||
<div className='flex flex-col justify-center gap-6 text-xl'> | ||
<div> | ||
<div className='text-4xl'>✏️</div> | ||
<p>다양한 여행지를 둘러보세요.</p> | ||
</div> | ||
<div> | ||
<div className='text-4xl'>🔖</div> | ||
<p>여행하고 싶은 곳을 저장해두세요.</p> | ||
</div> | ||
<div> | ||
<div className='text-4xl'>✉️</div> | ||
<p>유명 여행지를 동행인에게 공유해보세요.</p> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default PlaceBanner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React, { ReactNode } from 'react' | ||
|
||
interface PlaceFilterProps {} | ||
|
||
const PlaceFilter = ({}: PlaceFilterProps): ReactNode => { | ||
return <div>PlaceFilter</div> | ||
} | ||
|
||
export default PlaceFilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
'use client' | ||
|
||
import 'slick-carousel/slick/slick.css' | ||
import 'slick-carousel/slick/slick-theme.css' | ||
|
||
import Image from 'next/image' | ||
import React, { ReactNode, useEffect, useState } from 'react' | ||
import Slider from 'react-slick' | ||
|
||
import BusanImg from '@/public/images/busan.jpg' | ||
|
||
interface PopularPlaceProps {} | ||
|
||
const PopularPlace = ({}: PopularPlaceProps): ReactNode => { | ||
const [popular, setPopular] = useState<any>([]) | ||
const setting = { | ||
variableWidth: true, | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
} | ||
|
||
const getPopularPlace = async () => { | ||
try { | ||
const res = await fetch(`/server/places/popular`, { | ||
method: 'GET', | ||
}) | ||
|
||
if (res.ok) { | ||
const data = await res.json() | ||
// console.log(data) | ||
return data | ||
} | ||
|
||
console.log(res) | ||
|
||
const status = res.status | ||
switch (status) { | ||
default: | ||
// alert('오류입니다.') | ||
return | ||
} | ||
} catch (error) { | ||
console.log('Fetch error', error) | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
const getPlace = async () => { | ||
const data = await getPopularPlace() | ||
setPopular(data) | ||
} | ||
getPlace() | ||
|
||
console.log('popular', popular) | ||
}, []) | ||
|
||
const render = (item: any) => ( | ||
<div className='h-52' style={{ width: 240 }}> | ||
<div className='h-[90%] w-[90%] rounded-lg bg-tbSecondary p-3 hover:scale-105 hover:cursor-pointer'> | ||
<Image | ||
src={item.imageSrc || BusanImg} | ||
alt='BusanImg' | ||
width={200} | ||
height={200} | ||
quality={100} | ||
className='mb-2 h-2/3 w-full rounded-lg' | ||
/> | ||
<h2 className='text-lg font-medium'>{item.placeName}</h2> | ||
<p># {item.category}</p> | ||
</div> | ||
</div> | ||
) | ||
|
||
return ( | ||
<div className='mb-7'> | ||
<p className='mb-7 mt-10 text-3xl'>🔥 TraBook 인기 여행지 Top 10</p> | ||
<div className='h-56'> | ||
<Slider {...setting}> | ||
{popular && | ||
popular.map((item: any) => { | ||
return render(item) | ||
})} | ||
</Slider> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default PopularPlace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.