madiator.com/ui/component/wunderbar/view.jsx
2021-08-16 12:11:25 +02:00

21 lines
592 B
JavaScript

// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
import { useIsMobile } from 'effects/use-screensize';
import WunderbarSuggestions from 'component/wunderbarSuggestions';
type Props = {
doOpenMobileSearch: () => void,
};
export default function WunderBar(props: Props) {
const { doOpenMobileSearch } = props;
const isMobile = useIsMobile();
return isMobile ? (
<Button icon={ICONS.SEARCH} className="wunderbar__mobile-search" onClick={() => doOpenMobileSearch()} />
) : (
<WunderbarSuggestions />
);
}