Skip to content

Commit

Permalink
feat(ts): convert menu (#4652)
Browse files Browse the repository at this point in the history
* feat(ts): convert menu

- connectMenu
- menu
- menuSelect

* test(menu): use real results

* chore(deps): update helper

* chore(hits): correct type for addQueryId

* fix(ts): update helper again

* chore(bundlesize): bump (answers)
  • Loading branch information
Haroenv authored Feb 18, 2021
1 parent ea56662 commit 2271b43
Show file tree
Hide file tree
Showing 20 changed files with 865 additions and 655 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
],
"dependencies": {
"@types/googlemaps": "^3.39.6",
"algoliasearch-helper": "^3.3.4",
"algoliasearch-helper": "^3.4.4",
"classnames": "^2.2.5",
"events": "^1.1.0",
"hogan.js": "^3.0.2",
Expand Down Expand Up @@ -143,7 +143,7 @@
"bundlesize": [
{
"path": "./dist/instantsearch.production.min.js",
"maxSize": "66.15 kB"
"maxSize": "66.50 kB"
},
{
"path": "./dist/instantsearch.development.js",
Expand Down
19 changes: 7 additions & 12 deletions src/components/MenuSelect/MenuSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { h } from 'preact';
import cx from 'classnames';
import { find } from '../../lib/utils';
import Template from '../Template/Template';

type MenuSelectTemplates = {
defaultOption: string;
item: string;
};
import {
MenuSelectCSSClasses,
MenuSelectTemplates,
} from '../../widgets/menu-select/menu-select';
import { MenuRendererOptions } from '../../connectors/menu/connectMenu';

type MenuItem = {
/**
Expand All @@ -30,14 +30,9 @@ type MenuItem = {
};

type Props = {
cssClasses: {
root: string;
noRefinementRoot: string;
select: string;
option: string;
};
cssClasses: MenuSelectCSSClasses;
items: MenuItem[];
refine: (value: MenuItem['value']) => void;
refine: MenuRendererOptions['refine'];
templateProps: {
templates: MenuSelectTemplates;
};
Expand Down
Loading

0 comments on commit 2271b43

Please sign in to comment.