Skip to content

Commit c012b12

Browse files
committed
Replace text based toggle with image in HierarchicalMenu
1 parent 11191da commit c012b12

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/search/HierarchicalMenuWidget.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { SearchResults } from "algoliasearch-helper"
33
import type { Connector } from "instantsearch.js"
44
import type { AdditionalWidgetProperties } from "react-instantsearch"
55
import { useCallback, useEffect, useMemo, useState } from "react"
6+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
7+
import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons"
68

79
const cx = (...classNames: string[]): string =>
810
classNames.filter(Boolean).join(" ")
@@ -369,7 +371,11 @@ const MultiselectHierarchicalMenuItem = ({
369371
hasSubLevel ? "" : "--child"
370372
}`}
371373
>
372-
{isOpen ? "-" : "+"}
374+
{isOpen ? (
375+
<FontAwesomeIcon icon={faMinus} size="2xs" />
376+
) : (
377+
<FontAwesomeIcon icon={faPlus} size="2xs" />
378+
)}
373379
</button>
374380
) : (
375381
<input

0 commit comments

Comments
 (0)