Skip to content

Commit

Permalink
Merge pull request #24 from Ray-D-Song/search
Browse files Browse the repository at this point in the history
fix: search
  • Loading branch information
Ray-D-Song authored Nov 1, 2024
2 parents f135d4d + b9bf74c commit af0aba3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/preview-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- hotfix
- chunk
- search

jobs:
deploy:
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/(layout)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Layout() {
<SideBar />
<div className="flex-1">
<Hamburger className="lg:hidden block fixed top-[50%] left-0 cursor-pointer z-50" />
<Outlet context={{ keyword, searchTrigger, handleSearch }} />
<Outlet context={{ keyword, searchTrigger, handleSearch, setKeyword }} />
</div>
</div>
</SidebarProvider>
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/pages/(layout)/folder.[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import EmptyWrapper from '~/components/empty-wrapper'
import ListView from '~/components/list-view'
import AppContext from '~/store/app'
import LoadingMore from '~/components/loading-more'
import Header from '~/components/header'

function FolderPage() {
const { slug } = useParams('/folder/:slug')
Expand Down Expand Up @@ -64,12 +65,14 @@ function FolderPage() {
}

const { view } = useContext(AppContext)
const { setKeyword, handleSearch } = useOutletContext<{ keyword: string, setKeyword: (keyword: string) => void, handleSearch: () => void }>()

if (isNil(slug))
return <NotFound />

return (
<div className="flex flex-col flex-1">
<Header keyword={keyword} setKeyword={setKeyword} handleSearch={handleSearch} />
<ScrollArea ref={scrollRef} className="p-4 overflow-auto h-[calc(100vh-58px)]">
<LoadingWrapper loading={pagesLoading || (!pagesData)}>
<div className="h-full">
Expand Down

0 comments on commit af0aba3

Please sign in to comment.