Skip to content

Commit

Permalink
feat: hide course lessons in TheFeed
Browse files Browse the repository at this point in the history
  • Loading branch information
zacjones93 committed Feb 19, 2025
1 parent 931e351 commit 710b801
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/pages/home/the-feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import {QueryClient, QueryClientProvider} from '@tanstack/react-query'
import Pagination from '@/components/search/pagination'
import PresetOptions from '@/components/search/components/preset-options'
import {usePagination} from 'react-instantsearch'
import {typsenseAdapterConfig} from '@/utils/typesense'

typesenseAdapter.updateConfiguration({
...typsenseAdapterConfig,
additionalSearchParameters: {
preset: 'the_feed',
},
})
const searchClient = typesenseAdapter.searchClient
const queryClient = new QueryClient()

Expand Down
9 changes: 9 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import groq from 'groq'
import {getServerState} from 'react-instantsearch'
import {renderToString} from 'react-dom/server'
import TheFeed from '@/components/pages/home/the-feed'
import {typsenseAdapterConfig} from '@/utils/typesense'
import {typesenseAdapter} from './q/[[...all]]'

const HomePage: FunctionComponent<React.PropsWithChildren<any>> = ({
data,
Expand Down Expand Up @@ -87,6 +89,13 @@ const homepageQuery = groq`*[_type == 'resource' && slug.current == "curated-hom
export async function getStaticProps() {
const data = await sanityClient.fetch(homepageQuery)

typesenseAdapter.updateConfiguration({
...typsenseAdapterConfig,
additionalSearchParameters: {
preset: 'the_feed',
},
})

const searchServerState = await getServerState(<TheFeed />, {
renderToString,
})
Expand Down

0 comments on commit 710b801

Please sign in to comment.