2018-03-26 14:32:43 -07:00
|
|
|
// @flow
|
2018-11-25 20:21:25 -05:00
|
|
|
import * as ICONS from 'constants/icons';
|
2017-12-21 18:08:54 -03:00
|
|
|
import React from 'react';
|
2020-12-03 12:29:47 -05:00
|
|
|
import Button from 'component/button';
|
2020-12-11 13:33:27 -05:00
|
|
|
import { useIsMobile } from 'effects/use-screensize';
|
|
|
|
import WunderbarSuggestions from 'component/wunderbarSuggestions';
|
2018-10-04 01:59:47 -04:00
|
|
|
|
2018-03-26 14:32:43 -07:00
|
|
|
type Props = {
|
2020-12-11 13:33:27 -05:00
|
|
|
doOpenMobileSearch: () => void,
|
2018-03-26 14:32:43 -07:00
|
|
|
};
|
|
|
|
|
2020-12-03 12:29:47 -05:00
|
|
|
export default function WunderBar(props: Props) {
|
2020-12-11 13:33:27 -05:00
|
|
|
const { doOpenMobileSearch } = props;
|
|
|
|
const isMobile = useIsMobile();
|
2020-12-03 12:29:47 -05:00
|
|
|
|
2020-12-11 13:33:27 -05:00
|
|
|
return isMobile ? (
|
|
|
|
<Button icon={ICONS.SEARCH} className="wunderbar__mobile-search" onClick={() => doOpenMobileSearch()} />
|
|
|
|
) : (
|
|
|
|
<WunderbarSuggestions />
|
2020-12-03 12:29:47 -05:00
|
|
|
);
|
|
|
|
}
|