Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mdyoung3 committed May 2, 2024
1 parent 530a512 commit ff5cd5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions algolia-search/dist/islands/algolia-search.island.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion algolia-search/src/algolia-search.island.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Search = () => {
initialUiState.refinementList = {basic_page_type: currentSearchParams.get("page-type").split(',')}
}
if (currentSearchParams.get("shared")) {
initialUiState.refinementList = {basic_page_type: currentSearchParams.get("shared").split(',')}
initialUiState.refinementList = {shared_tags: currentSearchParams.get("shared").split(',')}
}

const searchIndex = window.drupalSettings?.stanfordAlgolia.index || process.env.ALGOLIA_INDEX;
Expand Down
9 changes: 4 additions & 5 deletions algolia-search/src/search-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const SearchForm = (props) => {
const sharedTypes = sharedRefinements.filter(item => item.isRefined).map(item => item.value);

if (pageTypes.length >= 1) searchParams.set("page-type", pageTypes.join(','))
if (sharedTypes.length >= 1) searchParams.set("shared-type", sharedTypes.join(','))
if (sharedTypes.length >= 1) searchParams.set("shared", sharedTypes.join(','))

window.history.replaceState(null, '', `?${searchParams.toString()}`);
}, [query, pageTypeRefinements, sharedRefinements])
Expand Down Expand Up @@ -91,9 +91,8 @@ const SearchForm = (props) => {
type="checkbox"
onChange={() => refinePageTypes(item.value)}
checked={item.isRefined}

/>
{item.value} ({item.count})d
{item.value} ({item.count})
</label>
</li>
)}
Expand All @@ -105,8 +104,7 @@ const SearchForm = (props) => {
<ul style={{listStyle: "none", paddingLeft: "0", marginInline: "0"}}>
{sharedRefinements.map((item, i) =>
<li
key={i}
className="w-fit flex items-center justify-center border border-black p-5 mb-5 last:mb-0"
key={`shared-i`}
style={{alignItems: "center"}}
>
<label style={{
Expand Down Expand Up @@ -146,6 +144,7 @@ const CustomCurrentRefinements = (props) => {
{items.map(refinement => {
return refinement.refinements.map((item, i) =>
<li key={`refinement-${i}`}>
<h1>Works</h1>
{item.value}
<button disabled={!canRefine} onClick={() => refine(item)}>Clear</button>
</li>
Expand Down

0 comments on commit ff5cd5a

Please sign in to comment.