-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy pathSearchBar.js
31 lines (30 loc) · 958 Bytes
/
SearchBar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React, { useEffect, useRef, useState } from 'react';
import './searchBar.scss';
import CommandMenu from '../components/CommandMenu';
export default function SearchBarWrapper(props) {
const [open, setOpen] = useState(false);
const [isApple, setIsApple] = useState(true);
useEffect(() => {
if (navigator.appVersion.indexOf("Apple") != -1) {
setIsApple(true);
}
}, [])
return null /* (
<>
<CommandMenu open={open} setOpen={setOpen} />
<div className='searchBox'>
<button className='searchButton' onClick={() => setOpen(true)} >
<span className='searchPlaceholder'>
<i className="searchIcon fas fa-magnifying-glass" />
<span className='searchPlaceholderText'>Search</span>
</span>
<div className='commandIconContainer'>
<span className='commandIcon'>
{isApple ? '⌘K' : 'Ctrl + K'}
</span>
</div>
</button>
</div>
</>
); */
}