-
Notifications
You must be signed in to change notification settings - Fork 0
/
SearchButtons.js
48 lines (45 loc) · 1.08 KB
/
SearchButtons.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from "react";
import { useSelector } from "react-redux";
const suggestions = [
"All",
"Music",
"Computer Programming",
"Comedy",
"News",
"Podcasts",
"Coding",
"Modi",
"Cricket",
"Movies",
"ReactJS tutorials",
"Podcasts",
"Coding",
"Modi",
"Cricket",
"Movies",
"ReactJS tutorials",
];
const SearchButtons = () => {
const { isMenuOpen } = useSelector((store) => store.app);
return (
<div
className={`search-buttons bg-white flex items-center h-12 ml-3 sm:px-0 w-full sm:w-[calc(100%-6rem)] relative sm:fixed overflow-x-auto top-0 sm:top-16 left-0 ${
isMenuOpen
? "sm:left-56 xl:left-24 xl:w-[calc(100%-6rem)]"
: "sm:left-24 xl:left-56 xl:w-[calc(100%-14rem)]"
} z-10`}
>
{suggestions.map((suggestion, id) => {
return (
<button
key={id}
className="py-2 px-3 bg-gray-200 rounded-lg mr-4 text-[14px] font-medium whitespace-nowrap"
>
{suggestion}
</button>
);
})}
</div>
);
};
export default SearchButtons;