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