generated from acdh-oeaw/template-app-next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move instantsearch providers into layout.tsx
- Loading branch information
1 parent
616f782
commit e469b67
Showing
6 changed files
with
152 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { ReactNode } from "react"; | ||
|
||
import { ThomasBernhardInstantSearchProvider } from "@/components/instantsearch/thomas-bernhard/thomasbernhard-instantsearchprovider"; | ||
|
||
interface LanguagesLayoutProps { | ||
children: ReactNode; | ||
} | ||
|
||
export default function LanguagesLayout(props: LanguagesLayoutProps): ReactNode { | ||
const { children } = props; | ||
|
||
return ( | ||
<ThomasBernhardInstantSearchProvider pageName="languages" pathnameField="language"> | ||
{children} | ||
</ThomasBernhardInstantSearchProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { ReactNode } from "react"; | ||
|
||
import { ThomasBernhardInstantSearchProvider } from "@/components/instantsearch/thomas-bernhard/thomasbernhard-instantsearchprovider"; | ||
|
||
interface LanguagesLayoutProps { | ||
children: ReactNode; | ||
params: { | ||
category: string; | ||
}; | ||
} | ||
|
||
export default function LanguagesLayout(props: LanguagesLayoutProps): ReactNode { | ||
const { children, params } = props; | ||
|
||
return ( | ||
<ThomasBernhardInstantSearchProvider | ||
filters={`contains.work.category:=${params.category}`} | ||
pageName={`works/${params.category}`} | ||
pathnameField="contains.work.id" | ||
queryArgsToMenuFields={{ language: "language" }} | ||
> | ||
{children} | ||
</ThomasBernhardInstantSearchProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters