@@ -21,10 +21,16 @@ import {
21
21
Combobox ,
22
22
useCombobox ,
23
23
InputBase ,
24
+ Checkbox ,
24
25
} from "@mantine/core" ;
25
26
import { useForm } from "@mantine/form" ;
26
27
import { notifications } from "@mantine/notifications" ;
27
- import { IconPlus , IconTrash , IconUserPlus } from "@tabler/icons-react" ;
28
+ import {
29
+ IconPlus ,
30
+ IconTrash ,
31
+ IconUserPlus ,
32
+ IconAlertTriangle ,
33
+ } from "@tabler/icons-react" ;
28
34
import {
29
35
LeadEntry ,
30
36
leadTitleSuggestions ,
@@ -68,6 +74,7 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
68
74
const [ newLeadName , setNewLeadName ] = useState ( "" ) ;
69
75
const [ newLeadEmail , setNewLeadEmail ] = useState ( "" ) ;
70
76
const [ newLeadTitle , setNewLeadTitle ] = useState ( "" ) ;
77
+ const [ newLeadNonVoting , setNewLeadNonVoting ] = useState ( false ) ;
71
78
72
79
// Combobox for title suggestions
73
80
const combobox = useCombobox ( {
@@ -126,6 +133,7 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
126
133
setNewLeadName ( "" ) ;
127
134
setNewLeadEmail ( "" ) ;
128
135
setNewLeadTitle ( "" ) ;
136
+ setNewLeadNonVoting ( false ) ;
129
137
130
138
// Fetch new organization data
131
139
fetchOrganizationData ( ) ;
@@ -169,12 +177,14 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
169
177
name : newLeadName . trim ( ) ,
170
178
username : newLeadEmail . trim ( ) ,
171
179
title : newLeadTitle . trim ( ) ,
180
+ nonVotingMember : newLeadNonVoting ,
172
181
} ,
173
182
] ) ;
174
183
175
184
setNewLeadName ( "" ) ;
176
185
setNewLeadEmail ( "" ) ;
177
186
setNewLeadTitle ( "" ) ;
187
+ setNewLeadNonVoting ( false ) ;
178
188
} ;
179
189
180
190
const handleQueueRemove = ( email : string ) => {
@@ -361,9 +371,9 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
361
371
Organization Leads
362
372
</ Title >
363
373
< Text size = "sm" c = "dimmed" mb = "md" >
364
- These users will be your Executive Council representatives and
365
- will be given management permissions for your org. These users
366
- must be paid members .
374
+ These users will be given management permissions for your org.
375
+ Voting members must be paid members and will be your org's
376
+ represenatives at Executive Council meetings .
367
377
</ Text >
368
378
369
379
< Table verticalSpacing = "sm" highlightOnHover >
@@ -395,9 +405,20 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
395
405
< Group gap = "sm" >
396
406
< Avatar name = { lead . name } color = "initials" />
397
407
< div >
398
- < Text fz = "sm" fw = { 500 } >
399
- { lead . name }
400
- </ Text >
408
+ < Group gap = "xs" >
409
+ < Text fz = "sm" fw = { 500 } >
410
+ { lead . name }
411
+ </ Text >
412
+ { lead . nonVotingMember && (
413
+ < Badge
414
+ color = "gray"
415
+ variant = "light"
416
+ size = "sm"
417
+ >
418
+ Non-Voting
419
+ </ Badge >
420
+ ) }
421
+ </ Group >
401
422
< Text fz = "xs" c = "dimmed" >
402
423
{ lead . username }
403
424
</ Text >
@@ -514,6 +535,31 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
514
535
</ Combobox . Options >
515
536
</ Combobox . Dropdown >
516
537
</ Combobox >
538
+
539
+ < Checkbox
540
+ label = "Non-voting member"
541
+ description = "Check this if the lead should not have voting rights in Executive Council"
542
+ checked = { newLeadNonVoting }
543
+ onChange = { ( e ) => setNewLeadNonVoting ( e . currentTarget . checked ) }
544
+ />
545
+
546
+ { newLeadNonVoting && (
547
+ < Alert
548
+ icon = { < IconAlertTriangle size = { 16 } /> }
549
+ color = "yellow"
550
+ variant = "light"
551
+ mt = "xs"
552
+ >
553
+ < Text size = "sm" fw = { 500 } mb = { 4 } >
554
+ Warning: Non-voting member
555
+ </ Text >
556
+ < Text size = "sm" >
557
+ This lead will have management permissions but will not
558
+ have voting rights in Executive Council meetings. Use this
559
+ designation carefully.
560
+ </ Text >
561
+ </ Alert >
562
+ ) }
517
563
</ Stack >
518
564
519
565
< Button
@@ -552,6 +598,11 @@ export const ManageOrganizationForm: React.FC<ManageOrganizationFormProps> = ({
552
598
{ toAdd . map ( ( lead ) => (
553
599
< Text key = { lead . username } fz = "sm" >
554
600
- { lead . name } ({ lead . username } ) - { lead . title }
601
+ { lead . nonVotingMember && (
602
+ < Badge color = "gray" variant = "light" size = "sm" ml = "xs" >
603
+ Non-Voting
604
+ </ Badge >
605
+ ) }
555
606
</ Text >
556
607
) ) }
557
608
</ Box >
0 commit comments