lbry-desktop/ui/component/wunderbar/view.jsx

22 lines
592 B
React
Raw Normal View History

2018-03-26 23:32:43 +02:00
// @flow
2018-11-26 02:21:25 +01:00
import * as ICONS from 'constants/icons';
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
);
}