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

[리팩토링] fsd 폴더 구조 적용 #55

Merged
merged 12 commits into from
Jan 12, 2025
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions app/courses/[id]/comments/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import PageListComment from '@/src/views/detail-comment'
import { getCourse } from '@/src/entities/course/api'

export default async function Page({ params }: { params: { id: number } }) {
const course = await getCourse(params.id)

return (
<PageListComment
courseId={params.id}
comments={course.comments_info.comments}
/>
)
}
8 changes: 8 additions & 0 deletions app/courses/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getCourse } from '@/src/entities/course/api'
import DetailCourse from '@/src/views/detail-course'

export default async function Page({ params }: { params: { id: number } }) {
const course = await getCourse(params.id)

return <DetailCourse courseId={params.id} course={course} />
}
7 changes: 7 additions & 0 deletions app/courses/add-region/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client'

import RegionCascader from '@/src/views/add-region'

export default function Page() {
return <RegionCascader />
}
5 changes: 5 additions & 0 deletions app/courses/new/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import AddCoursePlan from '@/src/widgets/AddCoursePlan'

export default function CourseNew() {
return <AddCoursePlan type='course' />
}
10 changes: 10 additions & 0 deletions app/courses/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ListCourse from '@/src/views/list-course'
import { getCourses } from '@/src/entities/course/api'
import { getFavoriteRegions } from '@/src/entities/user/api'

export default async function Page() {
const courses = await getCourses()
const favoriteRegions = await getFavoriteRegions()

return <ListCourse courses={courses} favoriteRegions={favoriteRegions} />
}
File renamed without changes.
4 changes: 4 additions & 0 deletions src/app/globals.css → app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ body {
font-family: Arial, Helvetica, sans-serif;
}

image {
width: 100%;
}

.ant-drawer-bottom > .ant-drawer-content-wrapper {
box-shadow: none;
}
Expand Down
14 changes: 7 additions & 7 deletions src/app/layout.tsx → app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Metadata } from 'next'
import './globals.css'
import Header from '@components/(layout)/Header'
import Footer from '@components/(layout)/Footer'
import LayoutSpacer from '@components/(layout)/LayoutSpacer'
import Spacer from '@/src/shared/ui/Spacer'
import DefaultHeader from '@/src/widgets/DefaultHeader'
import DefaultFooter from '@/src/widgets/DefaultFooter'
import localFont from 'next/font/local'
import { AnimatePresence } from 'framer-motion'
import { ConfigProvider } from 'antd'
import ReactQueryProvider from '@/app/provider/ReactQueryProvider'
import ReactQueryProvider from '@/src/shared/provider/ReactQueryProvider'

export const metadata: Metadata = {
title: 'WOOCO - 우코',
Expand Down Expand Up @@ -43,17 +43,17 @@ export default function RootLayout({
<html lang='kr' className={`h-vh ${pretendard.variable}`}>
<body className='h-full flex items-center flex-col overflow-y-scroll'>
<ReactQueryProvider>
<Header />
<DefaultHeader />
<ConfigProvider theme={theme}>
<AnimatePresence>
<div className='mx-auto flex-1 text-black w-full max-w-[375px]'>
{children}
<LayoutSpacer />
<Spacer height={60} notShowURLs={['/login']} />
</div>
</AnimatePresence>
</ConfigProvider>
</ReactQueryProvider>
<Footer />
<DefaultFooter />
</body>
</html>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Spacer from '@components/(layout)/Spacer'
import Spacer from '@/src/shared/ui/Spacer'
import Image from 'next/image'
import splashLogo from '@images/(logo)/splash_logo.svg'
import splashLogo from '@/src/assets/images/(logo)/splash_logo.svg'

export default async function Login() {
await new Promise((resolve) => setTimeout(resolve, 3000))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import splashLogo from '@images/(logo)/splash_logo.svg'
import splashLogo from '@/src/assets/images/(logo)/splash_logo.svg'
import Image from 'next/image'
import logo_long from '@images/(logo)/logo_long.png'
import logo_long from '@/src/assets/images/(logo)/logo_long.png'

export default function Splash() {
return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions app/notifications/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ListNotification from '@/src/views/list-notification'
import { getNotifications } from '@/src/entities/notification/api'

export default async function Page() {
const data = await getNotifications()
return <ListNotification data={data} />
}
5 changes: 5 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Main from '@/src/views/main'

export default function Page() {
return <Main />
}
8 changes: 8 additions & 0 deletions app/plans/[id]/update/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getCourse } from '@/src/entities/course/api'
import UpdatePlan from '@/src/views/update-plan'

export default async function Page() {
const course = await getCourse(1)

return <UpdatePlan data={course} />
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
'use client'

import { useRouter } from 'next/navigation'
import { Course } from '../getData'
import KakaoMap from '@/app/components/KakaoMap'
import { CourseType } from '@/src/entities/course/type'
import KakaoMap from '@/src/shared/ui/KakaoMap'
import { CopyOutlined } from '@ant-design/icons'
import { message } from 'antd'

export default function CourseCard({ courseData }: { courseData: Course }) {
interface CourseCardProps {
courseData: CourseType
}

export default function CourseCard({ courseData }: CourseCardProps) {
const { location, places, planned_for, id } = courseData
const router = useRouter()

Expand Down Expand Up @@ -47,7 +51,7 @@ export default function CourseCard({ courseData }: { courseData: Course }) {
<span>| 장소 정보</span>
<button
className='w-[50px] h-[30px] text-[12px] border rounded-[10px] cursor-pointer'
onClick={() => router.push('/schedules/1/update')}
onClick={() => router.push('/plans/1/update')}
>
수정
</button>
Expand Down
5 changes: 5 additions & 0 deletions app/plans/new/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import AddCoursePlan from '@/src/widgets/AddCoursePlan'

export default function Page() {
return <AddCoursePlan type='plan' />
}
26 changes: 26 additions & 0 deletions app/plans/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import CardCourse from '@/src/features/course/card-course'
import FloatingWriteButton from '@/src/widgets/FloatingWriteButton'
import { getCourses } from '@/src/entities/course/api'
import { getUser } from '@/src/entities/user/api'

export default async function Page() {
const courses = await getCourses()
const user = await getUser(1)

const userName = user.user_info.name

return (
<div className='w-full pt-[20px] pb-[20px] px-[16px] flex flex-col'>
<span className='border-b text-[18px] inline-flex items-center'>
<p className='font-bold'>{userName}</p>
<p>님의 코스 플랜</p>
</span>

{courses.map((_, index) => (
<CardCourse key={index} />
))}

<FloatingWriteButton />
</div>
)
}
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions app/users/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import DetailUser from '@/src/views/detail-user'
import { getUser } from '@/src/entities/user/api'

export default async function Page() {
const user = await getUser(1)

return <DetailUser user={user} />
}
7 changes: 7 additions & 0 deletions app/users/[id]/setting/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client'

import UpdateUser from '@/src/views/update-user'

export default function Page() {
return <UpdateUser />
}
23 changes: 0 additions & 23 deletions src/app/components/(course)/CoursePlaceCarousel.tsx

This file was deleted.

77 changes: 0 additions & 77 deletions src/app/components/(course)/getData.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/components/(layout)/LayoutSpacer.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/components/SectionDivider.tsx

This file was deleted.

57 changes: 0 additions & 57 deletions src/app/courses/[id]/components/CommentComponent.tsx

This file was deleted.

Loading
Loading