1
1
import React , { useMemo , useState } from "react" ;
2
+ import styled , { css } from "styled-components" ;
3
+ import { landscapeStyle } from "styles/landscapeStyle" ;
2
4
import { useNavigate , useParams } from "react-router-dom" ;
3
5
import { useDebounce } from "react-use" ;
4
- import styled from "styled-components" ;
5
6
import Skeleton from "react-loading-skeleton" ;
6
7
import { Searchbar , DropdownCascader } from "@kleros/ui-components-library" ;
7
8
import { rootCourtToItems , useCourtTree } from "queries/useCourtTree" ;
8
9
import { isUndefined } from "utils/index" ;
9
10
import { decodeURIFilter , encodeURIFilter , useRootPath } from "utils/uri" ;
10
11
11
12
const Container = styled . div `
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 4px;
16
+
17
+ ${ landscapeStyle (
18
+ ( ) =>
19
+ css `
20
+ flex-direction: row;
21
+ gap: calc(4px + (22 - 4) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
22
+ `
23
+ ) }
24
+ ` ;
25
+
26
+ const SearchBarContainer = styled . div `
27
+ width: 100%;
12
28
display: flex;
13
29
flex-wrap: wrap;
14
30
gap: 8px;
@@ -54,15 +70,7 @@ const Search: React.FC = () => {
54
70
} , [ courtTreeData ] ) ;
55
71
56
72
return (
57
- < div >
58
- < Container >
59
- < StyledSearchbar
60
- type = "text"
61
- placeholder = "Search By ID"
62
- value = { search }
63
- onChange = { ( e ) => setSearch ( e . target . value ) }
64
- />
65
- </ Container >
73
+ < Container >
66
74
{ items ? (
67
75
< DropdownCascader
68
76
items = { items }
@@ -76,7 +84,15 @@ const Search: React.FC = () => {
76
84
) : (
77
85
< Skeleton width = { 240 } height = { 42 } />
78
86
) }
79
- </ div >
87
+ < SearchBarContainer >
88
+ < StyledSearchbar
89
+ type = "text"
90
+ placeholder = "Search By ID"
91
+ value = { search }
92
+ onChange = { ( e ) => setSearch ( e . target . value ) }
93
+ />
94
+ </ SearchBarContainer >
95
+ </ Container >
80
96
) ;
81
97
} ;
82
98
0 commit comments