Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into production #2751

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions workspaces/website/src/pages/(components)/MainSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "src/style/algolia/theme.css";
import "src/style/algolia/overrides.css";

import {
AutocompleteOptions,
getAlgoliaResults,
Expand Down Expand Up @@ -100,7 +99,7 @@ export interface Props {
readonly ALGOLIA_APP_ID: string;
readonly ALGOLIA_SEARCH_API_KEY: string;
};
seo: SEOTexts['search']
seo: SEOTexts["search"];
}

export function MainSearch({ env, seo }: Props): JSX.Element | null {
Expand All @@ -109,7 +108,6 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
env.ALGOLIA_APP_ID,
env.ALGOLIA_SEARCH_API_KEY
);

const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({
key: "algolia-recent-searches-plugin",
limit: 3,
Expand Down Expand Up @@ -139,7 +137,7 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
},
onSelect({ setIsOpen }) {
setIsOpen(true);
}
},
};
},
});
Expand Down Expand Up @@ -173,11 +171,10 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
},
onSelect({ setIsOpen }) {
setIsOpen(true);
}
},
};
},
});

return { searchClient, recentSearchesPlugin, querySuggestionsPlugin };
}, [env.ALGOLIA_APP_ID, env.ALGOLIA_INDEX, env.ALGOLIA_SEARCH_API_KEY]);
const { locale } = usePageContext();
Expand All @@ -197,7 +194,6 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
placeholder={seo?.search}
getSources={({ query }) => {
if (!query) return [];

return [
{
sourceId: "posts",
Expand All @@ -207,7 +203,6 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
getItems() {
return getAlgoliaResults({
searchClient: data.searchClient,

queries: [
{
params: {
Expand Down Expand Up @@ -277,8 +272,7 @@ export function MainSearch({ env, seo }: Props): JSX.Element | null {
attributesToSnippet: ["title:8", "content:10"],
snippetEllipsisText: "...",
},

indexName: "starknet-docs-dev",
indexName: `starknet-docs-main`,
query,
},
],
Expand Down Expand Up @@ -378,10 +372,7 @@ export function PostItem({
components: { Highlight },
}: ItemProps<Post>) {
return (
<a
href={`/${hit.locale}/content/${hit.slug}`}
className="aa-ItemLink"
>
<a href={`/${hit.locale}/content/${hit.slug}`} className="aa-ItemLink">
<div className="aa-ItemContent">
<div className="aa-ItemIcon aa-ItemIcon--noBorder">
<svg
Expand Down
Loading