|
|
|
@ -19,7 +19,6 @@ import { |
|
|
|
|
InputLabel, |
|
|
|
|
Select, |
|
|
|
|
MenuItem, |
|
|
|
|
IconButton, |
|
|
|
|
Menu, |
|
|
|
|
ListItemIcon, |
|
|
|
|
ListItemText |
|
|
|
@ -39,16 +38,9 @@ import { |
|
|
|
|
CloudDownload, |
|
|
|
|
VerifiedUser, |
|
|
|
|
Favorite, |
|
|
|
|
CheckCircle, |
|
|
|
|
Schedule, |
|
|
|
|
Send, |
|
|
|
|
ArrowUpward, |
|
|
|
|
ArrowDownward, |
|
|
|
|
FilterList, |
|
|
|
|
Sort, |
|
|
|
|
SortByAlpha, |
|
|
|
|
Business, |
|
|
|
|
AccessTime, |
|
|
|
|
FamilyRestroom, |
|
|
|
|
Person, |
|
|
|
|
Work, |
|
|
|
@ -69,7 +61,6 @@ const ContactListPage = () => { |
|
|
|
|
const [groupFilter, setGroupFilter] = useState<string>('all'); |
|
|
|
|
const [sortBy, setSortBy] = useState<string>('name'); |
|
|
|
|
const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc'); |
|
|
|
|
const [filterMenuAnchor, setFilterMenuAnchor] = useState<null | HTMLElement>(null); |
|
|
|
|
const [sortMenuAnchor, setSortMenuAnchor] = useState<null | HTMLElement>(null); |
|
|
|
|
const theme = useTheme(); |
|
|
|
|
const navigate = useNavigate(); |
|
|
|
@ -210,45 +201,13 @@ const ContactListPage = () => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getNaoStatusIndicator = (contact: Contact) => { |
|
|
|
|
switch (contact.naoStatus) { |
|
|
|
|
case 'member': |
|
|
|
|
return { |
|
|
|
|
icon: <CheckCircle sx={{ fontSize: 16 }} />, |
|
|
|
|
label: 'NAO Member', |
|
|
|
|
color: theme.palette.success.main, |
|
|
|
|
bgColor: alpha(theme.palette.success.main, 0.08), |
|
|
|
|
borderColor: alpha(theme.palette.success.main, 0.2) |
|
|
|
|
}; |
|
|
|
|
case 'invited': |
|
|
|
|
return { |
|
|
|
|
icon: <Schedule sx={{ fontSize: 16 }} />, |
|
|
|
|
label: 'Invited', |
|
|
|
|
color: theme.palette.warning.main, |
|
|
|
|
bgColor: alpha(theme.palette.warning.main, 0.08), |
|
|
|
|
borderColor: alpha(theme.palette.warning.main, 0.2) |
|
|
|
|
}; |
|
|
|
|
default: |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleInviteToNao = (contact: Contact) => { |
|
|
|
|
// Navigate to invitation page with contact pre-filled
|
|
|
|
|
navigate(`/invite?inviteeName=${encodeURIComponent(contact.name)}&inviteeEmail=${encodeURIComponent(contact.email)}`); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleFilterClick = (event: React.MouseEvent<HTMLElement>) => { |
|
|
|
|
setFilterMenuAnchor(event.currentTarget); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleSortClick = (event: React.MouseEvent<HTMLElement>) => { |
|
|
|
|
setSortMenuAnchor(event.currentTarget); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleFilterClose = () => { |
|
|
|
|
setFilterMenuAnchor(null); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleSortClose = () => { |
|
|
|
|
setSortMenuAnchor(null); |
|
|
|
|