diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 962d2412e..683c4dfa1 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -355,7 +355,14 @@ export const DocsNav = ({
@@ -498,7 +512,14 @@ export const DocsNav = ({
diff --git a/pages/tools/components/Sidebar.tsx b/pages/tools/components/Sidebar.tsx index 5a1c75717..e53e78a8e 100644 --- a/pages/tools/components/Sidebar.tsx +++ b/pages/tools/components/Sidebar.tsx @@ -1,5 +1,9 @@ import React, { Dispatch, SetStateAction, useRef } from 'react'; -import FilterIcon from '~/public/icons/filter.svg'; +import LanguageIcon from '~/public/icons/language.svg'; +import ToolingIcon from '~/public/icons/tooling.svg'; +import EnvironmentIcon from '~/public/icons/environment.svg'; +import DialectIcon from '~/public/icons/dialect.svg'; +import LicenseIcon from '~/public/icons/license.svg'; import DropdownMenu from './ui/DropdownMenu'; import Checkbox from './ui/Checkbox'; import SearchBar from './SearchBar'; @@ -8,6 +12,14 @@ import type { Transform } from '../hooks/useToolsTransform'; import type { FilterCriteriaFields } from '../index.page'; import { postAnalytics } from '../lib/postAnalytics'; +const filterIcons = { + languages: LanguageIcon, + toolingTypes: ToolingIcon, + environments: EnvironmentIcon, + drafts: DialectIcon, + licenses: LicenseIcon, +}; + interface SidebarProps { filterCriteria: Record; transform: Transform; @@ -79,8 +91,14 @@ export default function Sidebar({ {filters.map(({ label, accessorKey }) => { const checkedValues = transform[accessorKey as keyof Transform] || []; + const IconComponent = + filterIcons[accessorKey as keyof typeof filterIcons]; return ( - }> + } + > {filterCriteria[accessorKey as FilterCriteriaFields] ?.map(String) .map((filterOption) => ( diff --git a/pages/tools/components/ui/DropdownMenu.tsx b/pages/tools/components/ui/DropdownMenu.tsx index 2ceaa0483..7352b179e 100644 --- a/pages/tools/components/ui/DropdownMenu.tsx +++ b/pages/tools/components/ui/DropdownMenu.tsx @@ -26,7 +26,7 @@ export default function DropdownMenu({ }, [router]); return ( -
+
{ @@ -34,7 +34,7 @@ export default function DropdownMenu({ }} > {React.cloneElement(icon, { - className: 'mr-2', + className: 'mr-2 ml-2', })}
{label} @@ -64,8 +64,11 @@ export default function DropdownMenu({
{children} diff --git a/public/icons/dialect.svg b/public/icons/dialect.svg new file mode 100644 index 000000000..45d952058 --- /dev/null +++ b/public/icons/dialect.svg @@ -0,0 +1 @@ + diff --git a/public/icons/environment.svg b/public/icons/environment.svg new file mode 100644 index 000000000..976203d0a --- /dev/null +++ b/public/icons/environment.svg @@ -0,0 +1 @@ + diff --git a/public/icons/language.svg b/public/icons/language.svg new file mode 100644 index 000000000..bbc79105e --- /dev/null +++ b/public/icons/language.svg @@ -0,0 +1 @@ + diff --git a/public/icons/license.svg b/public/icons/license.svg new file mode 100644 index 000000000..cbc1dc79d --- /dev/null +++ b/public/icons/license.svg @@ -0,0 +1,2 @@ + + diff --git a/public/icons/tooling.svg b/public/icons/tooling.svg new file mode 100644 index 000000000..7e32827d1 --- /dev/null +++ b/public/icons/tooling.svg @@ -0,0 +1 @@ +