Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Dec 16, 2022
1 parent df68d01 commit 441037b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
18 changes: 2 additions & 16 deletions searchlib/components/SearchApp/useSearchApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';

import { useAtom, useAtomValue } from 'jotai';

import useWhyDidYouUpdate from '@eeacms/search/lib/hocs/useWhyDidYouUpdate';
import {
getDefaultFilters,
rebind,
Expand All @@ -17,7 +16,7 @@ import { resetFilters, resetSearch } from './request';
import useFacetsWithAllOptions from './useFacetsWithAllOptions';
import { loadingFamily, driverFamily } from './state';

function useSearchDriver({ elasticConfig, appName }) {
export function useSearchDriver({ elasticConfig, appName }) {
const driverAtom = driverFamily({ elasticConfig, appName });
const driver = useAtomValue(driverAtom);

Expand All @@ -28,7 +27,7 @@ function useSearchDriver({ elasticConfig, appName }) {
return driver;
}

function useSearchApp({
export default function useSearchApp({
appName,
registry,
paramOnSearch,
Expand Down Expand Up @@ -113,17 +112,6 @@ function useSearchApp({
[appConfig, driverInstance, facetOptions],
);

useWhyDidYouUpdate('BasicSearchApp', {
appName,
registry,
appConfig,
driverInstance,
facetOptions,
onAutocomplete,
onSearch,
locationSearchTerm,
});

return {
facetOptions,
mapContextToProps,
Expand All @@ -132,5 +120,3 @@ function useSearchApp({
elasticConfig,
};
}

export default useSearchApp;
3 changes: 0 additions & 3 deletions src/SearchBlock/SearchBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SearchApp } from '@eeacms/search';
import { SearchBlockSchema } from './schema';
import { BodyClass } from '@plone/volto/helpers';
import { applyBlockSettings } from './utils';
import useWhyDidYouUpdate from '@eeacms/search/lib/hocs/useWhyDidYouUpdate';

// import '@elastic/react-search-ui-views/lib/styles/styles.css';
import './less/styles.less';
Expand Down Expand Up @@ -45,8 +44,6 @@ export default function SearchBlockView(props) {
return reg;
}, [appName, stableData, schema]);

useWhyDidYouUpdate('BlockView', { stableData });

// TODO: this is a hack, please solve it properly

return (
Expand Down

0 comments on commit 441037b

Please sign in to comment.