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

Commit 9c405ca

Browse files
git push origin developMerge branch 'issue-17' into develop
2 parents dc86d5b + d32470e commit 9c405ca

File tree

8 files changed

+245
-209
lines changed

8 files changed

+245
-209
lines changed

client/src/components/AddToGroupModal/index.jsx

Lines changed: 68 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -154,66 +154,76 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
154154
overlayClassName={style.overlay}
155155
>
156156
<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>
200157
<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+
)}
212226
</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>}
217227
<div className={style.buttons}>
218228
<Button onClick={onCancel} disabled={updatingGroups || creatingGroup}>
219229
Cancel

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

Lines changed: 4 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 {
@@ -88,4 +90,5 @@
8890
.message {
8991
color: $textColor2;
9092
font: 400 12pt/1.25 Inter;
93+
margin-left: 30px;
9194
}

0 commit comments

Comments
 (0)