Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3fc782f

Browse files
Merge branch 'develop' into issue-152
2 parents bded9dc + 8cabcb9 commit 3fc782f

File tree

22 files changed

+450
-350
lines changed

22 files changed

+450
-350
lines changed
Lines changed: 16 additions & 74 deletions
Loading

client/src/components/AddToGroupModal/index.jsx

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -162,57 +162,75 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
162162
overlayClassName={style.overlay}
163163
>
164164
<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>
204165
<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+
)}
216234
</div>
217235
<div className={style.buttons}>
218236
<Button onClick={onCancel} disabled={updatingGroups || creatingGroup}>

client/src/components/AddToGroupModal/style.module.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
.groups {
4646
margin: 0 -30px;
47-
max-height: 150px;
47+
max-height: calc(95vh - 157px);
4848
overflow-y: auto;
4949
}
5050

@@ -68,10 +68,12 @@
6868
.searchRow {
6969
display: flex;
7070
position: relative;
71+
margin: 0 30px;
7172
}
7273

7374
.subTitle {
7475
@include h3;
76+
margin-left: 30px;
7577
}
7678

7779
.title {
@@ -84,3 +86,9 @@
8486
left: 10px;
8587
top: 10px;
8688
}
89+
90+
.message {
91+
color: $textColor2;
92+
font: 400 12pt/1.25 Inter;
93+
margin-left: 30px;
94+
}

0 commit comments

Comments
 (0)