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