Skip to content

Commit

Permalink
fix: route
Browse files Browse the repository at this point in the history
  • Loading branch information
rabyeoljji committed Dec 11, 2024
1 parent 99863ea commit 6b4e747
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
29 changes: 21 additions & 8 deletions src/features/search/screen/all-search-results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button } from '@/shared/components/ui/button'
import CollectionSearchList from '../components/collection-search-list'
import SearchList from '../components/search-list'
import Icon from '@/shared/components/custom/icon'
import Link from 'next/link'

interface Props {
docsQuizLength: number
Expand Down Expand Up @@ -29,10 +30,16 @@ const AllSearchResults = ({
/>

{/* 퀴즈 노트 전체보기 버튼 : 클릭 시 tab = quiz-note로 변경 */}
<Button variant={'smallSquare'} colors={'tertiary'} className="h-fit w-full py-[13.5px]">
퀴즈노트 전체보기
<Icon name="chevron-right" className="size-[16px] text-icon-tertiary" />
</Button>
<Link href={`?tab=quiz-note&keyword=${keyword}`} replace>
<Button
variant={'smallSquare'}
colors={'tertiary'}
className="h-fit w-full py-[13.5px]"
>
퀴즈노트 전체보기
<Icon name="chevron-right" className="size-[16px] text-icon-tertiary" />
</Button>
</Link>
</div>
)}

Expand All @@ -44,10 +51,16 @@ const AllSearchResults = ({
/>

{/* 컬렉션 전체보기 버튼 : : 클릭 시 tab = collection으로 변경 */}
<Button variant={'smallSquare'} colors={'tertiary'} className="h-fit w-full py-[13.5px]">
컬렉션 전체보기
<Icon name="chevron-right" className="size-[16px] text-icon-tertiary" />
</Button>
<Link href={`?tab=collection&keyword=${keyword}`} replace>
<Button
variant={'smallSquare'}
colors={'tertiary'}
className="h-fit w-full py-[13.5px]"
>
컬렉션 전체보기
<Icon name="chevron-right" className="size-[16px] text-icon-tertiary" />
</Button>
</Link>
</div>
)}
</div>
Expand Down
9 changes: 2 additions & 7 deletions src/features/search/screen/search-in-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { ChangeEvent, useEffect, useRef, useState } from 'react'
import RecentSearches from '../components/recent-searches'
import HeaderInDocument from '../components/header-in-document'
import Text from '@/shared/components/ui/text'
import { useRouter, useSearchParams } from 'next/navigation'
import { useQuery } from '@tanstack/react-query'
import { queries } from '@/shared/lib/tanstack-query/query-keys'
Expand All @@ -12,6 +11,7 @@ import { RECENT_SEARCHES } from '../config'
import { getLocalStorage, setLocalStorage } from '@/shared/utils/storage'
import usePreviousPath from '@/shared/hooks/use-previous-path'
import SearchList from '../components/search-list'
import NoResults from './no-results'

// 퀴즈노트 탭 내 검색창 화면
const SearchInDocument = () => {
Expand Down Expand Up @@ -109,12 +109,7 @@ const SearchInDocument = () => {
{!isSearchFocused &&
// 검색 결과 X
(!data || searchResults.length === 0 ? (
<div className="flex-center h-[calc(100dvh-56px)] flex-col">
<Text typography="subtitle1-bold">검색결과가 없습니다</Text>
<Text typography="text1-medium" className="text-text-sub">
다른 키워드를 입력해보세요
</Text>
</div>
<NoResults className="h-[calc(100dvh-56px)]" />
) : (
// 검색 결과 O : 검색 결과 리스트
data &&
Expand Down

0 comments on commit 6b4e747

Please sign in to comment.