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

FIXUP - Adding hits per page configuration. #13

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Stanford c-ShARP Subtheme

1.0.0
1.0.2
--------------------------------------------------------------------------------
_Release Date: 202X-XX-XX_
_Release Date: 2024-05-16_
- Added configuration to instantsearch
- Set hitsPerPage to 1000
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [c-ShARP Subtheme](https://github.com/SU-SWS/c_ShARP_subtheme)
##### Version: 1.0.1
##### Version: 1.0.2

Changelog: [Changelog.txt](CHANGELOG.txt)
Changelog: [Changelog.md](CHANGELOG.md)

Description
---
Expand All @@ -19,8 +19,8 @@ The c-ShARP Subtheme is a Stanford sub-theme that works with the Stanford Basic

Documentation
---
See subtheming guides and best practices here:
https://devguide.sites.stanford.edu/front-end/drupal/sub-themes
See subtheming guides and best practices here:
https://devguide.sites.stanford.edu/front-end/drupal/sub-themes

Configuration
---
Expand Down
12 changes: 6 additions & 6 deletions algolia-search/dist/islands/algolia-search.island.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion algolia-search/src/algolia-search.island.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import algoliasearch from 'algoliasearch/lite';
import {createIslandWebComponent} from 'preact-island'
import {HitsProps, InstantSearch, useHits} from 'react-instantsearch';
import {HitsProps, InstantSearch, useHits, Configure} from 'react-instantsearch';
import SearchForm from "./search-form";
import EventHit from "./hits/events";
import NewsHit from "./hits/news";
import DefaultHit from "./hits/default-hit";
import styled from "styled-components";
import {StanfordHit} from "./hits/hit.types";
import {lazy} from "preact/compat";

const islandName = 'algolia-search'
const appId = window.drupalSettings?.stanfordAlgolia.appId || process.env.ALGOLIA_APP_ID
Expand Down Expand Up @@ -101,8 +102,12 @@ const Search = () => {
[searchIndex]: initialUiState,
}}
future={{preserveSharedStateOnUnmount: true}}

>
<Container>
<Configure
hitsPerPage={1000}
/>
<SearchForm/>
<CustomHits/>
</Container>
Expand Down
Loading
Loading