@@ -162,57 +162,75 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
162
162
overlayClassName = { style . overlay }
163
163
>
164
164
< h1 className = { style . title } > Add to Group</ h1 >
165
- < div className = { style . searchRow } >
166
- < ZoomIcon className = { style . zoomIcon } />
167
- < input
168
- className = { style . search }
169
- onChange = { ( { target } ) => {
170
- setFilter ( target . value ) ;
171
- setImmediate ( ( ) => target . focus ( ) ) ;
172
- } }
173
- placeholder = "Search or create group"
174
- value = { filter }
175
- disabled = { loadingGroups }
176
- />
177
- < Button
178
- className = { style . createButton }
179
- onClick = { createGroup }
180
- disabled = { creatingGroup }
181
- >
182
- { creatingGroup ? "Creating..." : "+ Create" }
183
- </ Button >
184
- </ div >
185
- < h3 className = { style . subTitle } >
186
- My groups{ loadingGroups && " (Loading...)" }
187
- </ h3 >
188
- < div className = { style . groups } >
189
- { ! loadingGroups &&
190
- myGroups
191
- . filter ( ( g ) => g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) ) )
192
- . map ( ( g ) => (
193
- < Group
194
- checked = { g . isSelected === true }
195
- group = { g }
196
- key = { g . id }
197
- onSwitch = { ( ) => switchSelected ( g ) }
198
- />
199
- ) ) }
200
- </ div >
201
- < h3 className = { style . subTitle } >
202
- Other Groups{ loadingGroups && " (Loading...)" }
203
- </ h3 >
204
165
< div className = { style . groups } >
205
- { ! loadingGroups &&
206
- otherGroups
207
- . filter ( ( g ) => g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) ) )
208
- . map ( ( g ) => (
209
- < Group
210
- checked = { g . isSelected === true }
211
- group = { g }
212
- key = { g . id }
213
- onSwitch = { ( ) => switchSelected ( g ) }
214
- />
215
- ) ) }
166
+ < div className = { style . searchRow } >
167
+ < ZoomIcon className = { style . zoomIcon } />
168
+ < input
169
+ className = { style . search }
170
+ onChange = { ( { target } ) => {
171
+ setFilter ( target . value ) ;
172
+ setImmediate ( ( ) => target . focus ( ) ) ;
173
+ } }
174
+ placeholder = "Search or create group"
175
+ value = { filter }
176
+ disabled = { loadingGroups }
177
+ />
178
+ < Button
179
+ className = { style . createButton }
180
+ onClick = { createGroup }
181
+ disabled = { creatingGroup }
182
+ >
183
+ { creatingGroup ? "Creating..." : "+ Create" }
184
+ </ Button >
185
+ </ div >
186
+ < h3 className = { style . subTitle } >
187
+ My groups{ loadingGroups && " (Loading...)" }
188
+ </ h3 >
189
+ < div >
190
+ { ! loadingGroups &&
191
+ myGroups
192
+ . filter ( ( g ) =>
193
+ g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) )
194
+ )
195
+ . map ( ( g ) => (
196
+ < Group
197
+ checked = { g . isSelected === true }
198
+ group = { g }
199
+ key = { g . id }
200
+ onSwitch = { ( ) => switchSelected ( g ) }
201
+ />
202
+ ) ) }
203
+ </ div >
204
+ { myGroups . filter ( ( g ) =>
205
+ g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) )
206
+ ) . length === 0 &&
207
+ ! loadingGroups && (
208
+ < div className = { style . message } > No results found</ div >
209
+ ) }
210
+ < h3 className = { style . subTitle } >
211
+ Other Groups{ loadingGroups && " (Loading...)" }
212
+ </ h3 >
213
+ < div >
214
+ { ! loadingGroups &&
215
+ otherGroups
216
+ . filter ( ( g ) =>
217
+ g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) )
218
+ )
219
+ . map ( ( g ) => (
220
+ < Group
221
+ checked = { g . isSelected === true }
222
+ group = { g }
223
+ key = { g . id }
224
+ onSwitch = { ( ) => switchSelected ( g ) }
225
+ />
226
+ ) ) }
227
+ </ div >
228
+ { otherGroups . filter ( ( g ) =>
229
+ g . name . toLowerCase ( ) . includes ( filter . toLowerCase ( ) )
230
+ ) . length === 0 &&
231
+ ! loadingGroups && (
232
+ < div className = { style . message } > No results found</ div >
233
+ ) }
216
234
</ div >
217
235
< div className = { style . buttons } >
218
236
< Button onClick = { onCancel } disabled = { updatingGroups || creatingGroup } >
0 commit comments