mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
- Filtered out the Family device user type from the todo filter options
This commit is contained in:
@ -8,7 +8,7 @@ import {IToDo} from "@/hooks/firebase/types/todoData";
|
|||||||
import DropdownIcon from "@/assets/svgs/DropdownIcon";
|
import DropdownIcon from "@/assets/svgs/DropdownIcon";
|
||||||
import {Dropdown} from "react-native-element-dropdown";
|
import {Dropdown} from "react-native-element-dropdown";
|
||||||
import {useGetFamilyMembers} from "@/hooks/firebase/useGetFamilyMembers";
|
import {useGetFamilyMembers} from "@/hooks/firebase/useGetFamilyMembers";
|
||||||
import {useAuthContext} from "@/contexts/AuthContext";
|
import {ProfileType, useAuthContext} from "@/contexts/AuthContext";
|
||||||
import {StyleSheet} from "react-native";
|
import {StyleSheet} from "react-native";
|
||||||
|
|
||||||
const FILTER_OPTIONS = {
|
const FILTER_OPTIONS = {
|
||||||
@ -92,12 +92,16 @@ const groupToDosByDate = (toDos: IToDo[]) => {
|
|||||||
|
|
||||||
const resolveFilterOptions = (members, user) => {
|
const resolveFilterOptions = (members, user) => {
|
||||||
|
|
||||||
let options = members?.map((member) => {
|
let options = [];
|
||||||
|
members?.forEach((member) => {
|
||||||
let label = member?.firstName;
|
let label = member?.firstName;
|
||||||
if (member.uid === user?.uid) {
|
if (member.uid === user?.uid) {
|
||||||
label = FILTER_OPTIONS.ME;
|
label = FILTER_OPTIONS.ME;
|
||||||
}
|
}
|
||||||
return {value: member?.uid, label: label};
|
|
||||||
|
if (member.userType !== ProfileType.FAMILY_DEVICE) {
|
||||||
|
options.push({value: member?.uid, label: label});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
options.push({value: FILTER_OPTIONS.EVERYONE, label: FILTER_OPTIONS.EVERYONE})
|
options.push({value: FILTER_OPTIONS.EVERYONE, label: FILTER_OPTIONS.EVERYONE})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user