Skip to content

Commit

Permalink
feat: 관심목록 페이지 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
yoouung committed Jan 16, 2025
1 parent 157a766 commit 4e69935
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions app/users/[id]/wishlist/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getCourses } from '@/src/entities/course/api'
import ListCourse from '@/src/widgets/list-course'

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

return <ListCourse courses={courses} title='관심 목록' />
}
2 changes: 1 addition & 1 deletion src/views/list-course/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Main({ trendingCourses, favoriteRegions, courses }: ListCourseProps) {
const router = useRouter()

if (location) {
return <CourseList location={location} courses={courses} />
return <CourseList title={location} courses={courses} />
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Header({
const path = usePathname()
const router = useRouter()

const isUpdateUser = path?.includes('/users') && !path?.includes('setting')
const isUpdateUser = /\/users(?!.*(setting|wishlist))/.test(path)

useEffect(() => {
return () => {
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/list-course/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import Spacer from '@/src/shared/ui/Spacer'
import SelectCategories from '@/src/shared/ui/SelectCategories'

export default function ListCourse({
location,
title,
courses,
}: {
location: string
title: string
courses: CourseType[]
}) {
const [isListView, setIsListView] = useState(true)
Expand All @@ -26,7 +26,7 @@ export default function ListCourse({
return (
<div className='w-full h-[calc(100%-50px)] pb-[20px] flex flex-col relative overflow-y-auto'>
<Header
title={location}
title={title}
isTitleTag={true}
isBack
isListView={isListView}
Expand Down

0 comments on commit 4e69935

Please sign in to comment.