@@ -21,14 +21,16 @@ import { IconButton } from '../../common/icon-button';
21
21
22
22
const ConfigContainer = styled . div `
23
23
user-select: text;
24
- max-height: 440px;
25
24
26
25
height: 100%;
27
- width: 100% ;
26
+ max-height: 390px ;
28
27
display: flex;
29
28
flex-direction: column;
30
29
justify-content: start;
31
30
31
+ margin: 5px -15px -15px -15px;
32
+ width: calc(100% + 30px);
33
+
32
34
> p {
33
35
line-height: 1.2;
34
36
@@ -50,32 +52,59 @@ const ConfigContainer = styled.div`
50
52
}
51
53
` ;
52
54
53
- const BackAndSearchBlock = styled . div `
54
- margin: 5px -15px 0;
55
+ const FridaTargetList = styled ( InterceptionTargetList ) `
56
+ padding: 10px 0;
57
+ margin: 0;
58
+ ` ;
55
59
60
+ const SelectedHostBlock = styled . div `
56
61
display: flex;
57
62
flex-direction: row;
58
63
align-items: stretch;
59
64
60
65
z-index: 1;
61
66
box-shadow: 0 0 5px 2px rgba(0,0,0,${ p => p . theme . boxShadowAlpha } );
67
+ ` ;
62
68
69
+ const SelectedHostName = styled . h2 `
70
+ height: 34px;
71
+ flex-grow: 1;
72
+
73
+ line-height: 32px;
74
+ text-align: center;
75
+
76
+ overflow: hidden;
77
+ white-space: nowrap;
78
+ text-overflow: ellipsis;
63
79
` ;
64
80
65
81
const BackButton = styled ( IconButton ) . attrs ( ( ) => ( {
66
82
icon : [ 'fas' , 'arrow-left' ] ,
67
83
title : 'Jump to this request on the View page'
68
84
} ) ) `
69
85
font-size: ${ p => p . theme . textSize } ;
70
- padding: 2px 10px 0 ;
86
+ padding: 0 10px;
71
87
` ;
72
88
73
- const SearchBox = styled ( TextInput ) `
74
- flex-grow: 1;
89
+ // Spacer - used to center align the name despite the back button
90
+ const NameSpacer = styled . div `
91
+ flex-basis: 34px;
92
+ flex-shrink: 999;
93
+ min-width: 5px;
94
+ ` ;
75
95
76
- border: none;
96
+ const SearchBox = styled ( TextInput ) `
97
+ border-style: solid;
98
+ border-width: 1px 0 1px 0;
99
+ border-color: ${ p => p . theme . inputHoverBackground } ;
77
100
border-radius: 0;
101
+
78
102
padding: 10px 10px 8px;
103
+
104
+ :focus {
105
+ outline: none;
106
+ border-color: ${ p => p . theme . inputBorder } ;
107
+ }
79
108
` ;
80
109
81
110
@inject ( 'proxyStore' )
@@ -227,16 +256,18 @@ class FridaConfig extends React.Component<{
227
256
) ;
228
257
229
258
return < ConfigContainer >
230
- < BackAndSearchBlock >
259
+ < SelectedHostBlock >
231
260
< BackButton onClick = { this . deselectHost } />
232
- < SearchBox
233
- value = { this . searchInput }
234
- onChange = { this . onSearchChange }
235
- placeholder = 'Search for a target...'
236
- autoFocus = { true }
237
- />
238
- </ BackAndSearchBlock >
239
- < InterceptionTargetList
261
+ < SelectedHostName > { selectedHost . name } </ SelectedHostName >
262
+ < NameSpacer />
263
+ </ SelectedHostBlock >
264
+ < SearchBox
265
+ value = { this . searchInput }
266
+ onChange = { this . onSearchChange }
267
+ placeholder = 'Search for a target...'
268
+ autoFocus = { true }
269
+ />
270
+ < FridaTargetList
240
271
spinnerText = 'Scanning for apps to intercept...'
241
272
targets = { targets . map ( target => {
242
273
const { id, name } = target ;
@@ -248,9 +279,7 @@ class FridaConfig extends React.Component<{
248
279
status : activating
249
280
? 'activating'
250
281
: 'available' ,
251
- content : < p >
252
- { name }
253
- </ p >
282
+ content : name
254
283
} ;
255
284
} )
256
285
}
@@ -261,7 +290,7 @@ class FridaConfig extends React.Component<{
261
290
}
262
291
263
292
return < ConfigContainer >
264
- < InterceptionTargetList
293
+ < FridaTargetList
265
294
spinnerText = { `Waiting for ${ this . deviceClassName } devices to attach to...` }
266
295
targets = { this . fridaHosts . map ( host => {
267
296
const { id, name, state } = host ;
0 commit comments