1
- const { Button } = VM . require ( "${config_account }/widget/components" ) || {
1
+ const { Button } = VM . require ( "${alias_old }/widget/components" ) || {
2
2
Button : ( ) => < > </ > ,
3
3
} ;
4
4
@@ -30,6 +30,7 @@ const SearchIcon = styled.div`
30
30
` ;
31
31
32
32
const SearchBarInput = styled . input `
33
+ color: white;
33
34
background: none;
34
35
width: 100%;
35
36
outline: none;
@@ -40,79 +41,8 @@ const SearchBarInput = styled.input`
40
41
}
41
42
` ;
42
43
43
- const FilterButton = styled . div `
44
- font-weight: 500;
45
- font-size: 14px;
46
- display: flex;
47
- align-items: center;
48
- gap: 0.5rem;
49
- cursor: pointer;
50
- width: fit-content;
51
- padding: 0.54rem 1rem;
52
- border-radius: 6px;
53
- border: 1px solid #7b7b7b;
54
- transition: all 200ms ease-in-out;
55
- &.active {
56
- color: #fff;
57
- background: #292929;
58
- }
59
- ` ;
60
-
61
- const FilterIcon = styled . div `
62
- display: flex;
63
- width: 16px;
64
- height: 16px;
65
- align-items: center;
66
- justify-content: center;
67
- ` ;
68
-
69
- const FilterMenu = styled . div `
70
- position: absolute;
71
- background: #fff;
72
- font-size: 14px;
73
- top: 110%;
74
- right: 0;
75
- padding: 8px;
76
- display: flex;
77
- flex-direction: column;
78
- gap: 8px;
79
- border-radius: 6px;
80
- border: 1px solid rgba(41, 41, 41, 0.36);
81
- box-shadow:
82
- 0px 12px 20px -4px rgba(123, 123, 123, 0.32),
83
- 0px 4px 8px -3px rgba(123, 123, 123, 0.2),
84
- 0px 0px 2px 0px rgba(123, 123, 123, 0.36);
85
- z-index: 2;
86
- opacity: 0;
87
- visibility: hidden;
88
- transform: translateY(100px);
89
- transition: all 200ms ease-in-out;
90
- &.active {
91
- opacity: 1;
92
- visibility: visible;
93
- transform: translateY(0);
94
- }
95
- @media screen and (max-width: 768px) {
96
- left: 0;
97
- background: #fff;
98
- }
99
- ` ;
100
-
101
- const FilterItem = styled . div `
102
- cursor: pointer;
103
- padding: 8px;
104
- display: flex;
105
- gap: 12px;
106
- white-space: nowrap;
107
- &:hover {
108
- background: #292929;
109
- color: #fff;
110
- border-radius: 6px;
111
- }
112
- ` ;
113
-
114
- const { numItems, itemName, onSearch } = props ;
115
- const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
44
+ const { numItems, itemName, onSearch, term } = props ;
45
+ const [ searchTerm , setSearchTerm ] = useState ( term ) ;
116
46
117
47
const onSearchChange = ( value ) => {
118
48
setSearchTerm ( value ) ;
@@ -126,7 +56,7 @@ const handleKeyDown = (event) => {
126
56
} ;
127
57
128
58
return (
129
- < >
59
+ < div className = "d-flex gap-3 align-items-center" >
130
60
< Row >
131
61
< SearchIcon >
132
62
< svg
@@ -150,9 +80,9 @@ return (
150
80
autocomplete = "search"
151
81
onKeyDown = { handleKeyDown }
152
82
/>
153
- < Button variant = "primary" onClick = { ( ) => onSearch ( searchTerm ) } >
154
- Search
155
- </ Button >
156
83
</ Row >
157
- </ >
84
+ < Button variant = "primary" onClick = { ( ) => onSearch ( searchTerm ) } >
85
+ Search
86
+ </ Button >
87
+ </ div >
158
88
) ;
0 commit comments