diff --git a/apps/mobile/app/components/HamburgerMenu.tsx b/apps/mobile/app/components/HamburgerMenu.tsx index 99fd8b516..c02cd21c4 100644 --- a/apps/mobile/app/components/HamburgerMenu.tsx +++ b/apps/mobile/app/components/HamburgerMenu.tsx @@ -91,7 +91,7 @@ const HamburgerMenu = observer((props: any) => { marginTop: 4, }} > - {user?.email}s + {user?.email} {activeTeam ? ( = observer( return ( <> onChangePriority(e.value)} onDismiss={() => setOpenModal(false)} @@ -81,7 +81,11 @@ const TaskPriority: FC = observer( )} - + diff --git a/apps/mobile/app/components/TaskSize.tsx b/apps/mobile/app/components/TaskSize.tsx index 56aa7ee0d..b5c71b279 100644 --- a/apps/mobile/app/components/TaskSize.tsx +++ b/apps/mobile/app/components/TaskSize.tsx @@ -88,7 +88,11 @@ const TaskSize: FC = observer(({ task, containerStyle, setSize, s )} - + diff --git a/apps/mobile/app/components/TaskSizePopup.tsx b/apps/mobile/app/components/TaskSizePopup.tsx index 333a8f1fd..b315b0db7 100644 --- a/apps/mobile/app/components/TaskSizePopup.tsx +++ b/apps/mobile/app/components/TaskSizePopup.tsx @@ -103,6 +103,7 @@ interface ItemProps { const Item: FC = ({ currentSizeName, size, onSizeSelected }) => { const { colors } = useAppTheme() const selected = size.value === currentSizeName + return ( onSizeSelected(size)}> diff --git a/apps/mobile/app/components/TaskStatus.tsx b/apps/mobile/app/components/TaskStatus.tsx index e0f487b20..05cd52b86 100644 --- a/apps/mobile/app/components/TaskStatus.tsx +++ b/apps/mobile/app/components/TaskStatus.tsx @@ -54,7 +54,7 @@ const TaskStatus: FC = observer( return ( <> onChangeStatus(e)} onDismiss={() => setOpenModal(false)} @@ -90,7 +90,11 @@ const TaskStatus: FC = observer( )} )} - + diff --git a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx index 5ffc9598a..9a417987d 100644 --- a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx +++ b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx @@ -16,6 +16,7 @@ import { Avatar } from "react-native-paper" import { observer } from "mobx-react-lite" import { limitTextCharaters } from "../../helpers/sub-text" import { useNavigation } from "@react-navigation/native" +import { FlatList } from "react-native-gesture-handler" export interface Props { teams: IOrganizationTeamList[] @@ -73,15 +74,28 @@ const DropDownSection: FC = observer(function DropDownSection({ {activeTeamId && ( )} - {others.map((item, index) => ( - - ))} + + ( + + + + )} + /> onCreateTeam()} diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx index c21eca66d..4046a53cc 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx @@ -258,7 +258,7 @@ const ListCardItem: React.FC = (props) => { return ( @@ -285,6 +285,14 @@ const ListCardItem: React.FC = (props) => { export default ListCardItem const styles = StyleSheet.create({ + cardContainer: { + borderRadius: 14, + elevation: 24, + shadowColor: "#000", + shadowOffset: { width: 0, height: 12 }, + shadowOpacity: 0.05, + shadowRadius: 5, + }, dropdownTxt: { color: "#282048", fontFamily: typography.primary.semiBold, diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskLabelFilter.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskLabelFilter.tsx index e6ed5e7c6..ba70a1d25 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskLabelFilter.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskLabelFilter.tsx @@ -7,11 +7,11 @@ import { Text, StyleSheet, ViewStyle, - ScrollView, Dimensions, Animated, Modal, TouchableWithoutFeedback, + FlatList, } from "react-native" import { AntDesign, Feather, FontAwesome } from "@expo/vector-icons" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" @@ -92,16 +92,21 @@ const TaskStatusFilterDropDown: FC = observer( > Statuses - - {allTaskLabels.map((item, idx) => ( - - ))} - + + ( + + )} + /> + diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskPriorityFilter.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskPriorityFilter.tsx index 8409e1723..670fbfd5e 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskPriorityFilter.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskPriorityFilter.tsx @@ -7,11 +7,11 @@ import { Text, StyleSheet, ViewStyle, - ScrollView, Dimensions, Animated, Modal, TouchableWithoutFeedback, + FlatList, } from "react-native" import { AntDesign, Feather, FontAwesome } from "@expo/vector-icons" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" @@ -99,16 +99,21 @@ const TaskStatusFilterDropDown: FC = observer( > Statuses - - {allTaskPriorities.map((item, idx) => ( - - ))} - + + ( + + )} + /> + diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskSizeFilter.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskSizeFilter.tsx index c22687a57..4a160b4f2 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskSizeFilter.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskSizeFilter.tsx @@ -7,11 +7,11 @@ import { Text, StyleSheet, ViewStyle, - ScrollView, Dimensions, Animated, Modal, TouchableWithoutFeedback, + FlatList, } from "react-native" import { AntDesign, Feather, FontAwesome } from "@expo/vector-icons" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" @@ -92,16 +92,21 @@ const TaskStatusFilterDropDown: FC = observer( > Statuses - - {allTaskSizes.map((item, idx) => ( - - ))} - + + ( + + )} + /> + diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskStatusFilter.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskStatusFilter.tsx index 9bb18b6a0..38098a788 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskStatusFilter.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TaskStatusFilter.tsx @@ -7,11 +7,11 @@ import { Text, StyleSheet, ViewStyle, - ScrollView, Dimensions, Animated, Modal, TouchableWithoutFeedback, + FlatList, } from "react-native" import { AntDesign, Feather, FontAwesome } from "@expo/vector-icons" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" @@ -93,16 +93,21 @@ const TaskStatusFilterDropDown: FC = observer( > Statuses - - {allStatuses.map((item, idx) => ( - - ))} - + + ( + + )} + /> + diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TimerButton.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TimerButton.tsx index 0172c68b1..8e2837384 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TimerButton.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/TimerButton.tsx @@ -82,7 +82,7 @@ const styles = StyleSheet.create({ shadowTimerNotRunning: { elevation: 10, shadowColor: "#3826A6", - shadowOffset: { width: 0, height: 10 }, + shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.5, shadowRadius: 10, }, diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/UserProfileTasks.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/UserProfileTasks.tsx index 31d479c6a..cac54450f 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/UserProfileTasks.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/UserProfileTasks.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ -import { Dimensions, ScrollView, Text, TextStyle, View } from "react-native" +import { Dimensions, FlatList, ScrollView, Text, TextStyle, View } from "react-native" import React, { FC, useMemo } from "react" import { IUserProfile } from "../logics/useProfileScreenLogic" import { ITaskFilter } from "../../../../services/hooks/features/useTaskFilters" @@ -27,143 +27,170 @@ const UserProfileTasks: FC = observer(({ profile, content }) }, [content, profile]) return ( - - {content.tab === "worked" && - profile.activeUserTeamTask && - (profile.member?.timerStatus === "running" || - (profile.isAuthUser && timerStatus?.running)) ? ( - <> - - - {translate("tasksScreen.now")} - - - - + {content.tab === "worked" && ( + + {content.tab === "worked" && + profile.activeUserTeamTask && + (profile.member?.timerStatus === "running" || + (profile.isAuthUser && timerStatus?.running)) ? ( + <> + - {translate("tasksScreen.totalTimeLabel")}: - - - - - - - - ) : null} - - {content.tab === "worked" && ( - - - - {translate("tasksScreen.last24hours")} ({tasks.length}) - - - - {tasks.map((task, index) => ( - + + {translate("tasksScreen.now")} + + + + + {translate("tasksScreen.totalTimeLabel")}: + + + + + - - ))} - - )} - - {content.tab === "assigned" && ( - - {content.tasksFiltered.map((task, index) => ( - - + + ) : null} + + {content.tab === "worked" && ( + + + + {translate("tasksScreen.last24hours")} ({tasks.length}) + + + + {tasks.map((task, index) => ( + + + + ))} - ))} - + )} + )} - {content.tab === "unassigned" && ( - - {content.tasksFiltered.map((task, index) => ( - - - - ))} + {(content.tab === "assigned" || content.tab === "unassigned") && ( + + {content.tab === "assigned" && ( + ( + + + + )} + /> + )} + + {content.tab === "unassigned" && ( + ( + + + + )} + /> + )} )} - + ) }) diff --git a/apps/mobile/app/screens/Authenticated/TaskLabelScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TaskLabelScreen/index.tsx index 8f5d88838..ba5baaecc 100644 --- a/apps/mobile/app/screens/Authenticated/TaskLabelScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TaskLabelScreen/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { FC, useState } from "react" -import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, ScrollView } from "react-native" +import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, FlatList } from "react-native" import { AntDesign, Ionicons } from "@expo/vector-icons" import { Screen } from "../../../components" import { AuthenticatedDrawerScreenProps } from "../../../navigators/AuthenticatedNavigator" @@ -36,8 +36,6 @@ export const TaskLabelScreen: FC @@ -52,7 +50,7 @@ export const TaskLabelScreen: FC - + {translate("settingScreen.labelScreen.listLabels")} @@ -63,23 +61,24 @@ export const TaskLabelScreen: FC ) : null} - {labels?.items?.map((item, index) => ( - + + ( openForEdit(item)} onDeleteLabel={() => deleteLabel(item.id)} label={item} /> - - ))} + )} + keyExtractor={(_, index) => index.toString()} + ListFooterComponent={() => } + /> - + { diff --git a/apps/mobile/app/screens/Authenticated/TaskPrioritiesScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TaskPrioritiesScreen/index.tsx index 919ef28c2..fdf1e3b86 100644 --- a/apps/mobile/app/screens/Authenticated/TaskPrioritiesScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TaskPrioritiesScreen/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { FC, useState } from "react" -import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, ScrollView } from "react-native" +import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, FlatList } from "react-native" import { AntDesign, Ionicons } from "@expo/vector-icons" import { Screen } from "../../../components" import { AuthenticatedDrawerScreenProps } from "../../../navigators/AuthenticatedNavigator" @@ -37,8 +37,6 @@ export const TaskPriorityScreen: FC @@ -53,7 +51,7 @@ export const TaskPriorityScreen: FC - + {translate("settingScreen.priorityScreen.listPriorities")} @@ -66,23 +64,24 @@ export const TaskPriorityScreen: FC ) : null} - {priorities?.items?.map((item, index) => ( - + + ( openForEdit(item)} onDeletePriority={() => deletePriority(item.id)} priority={item} /> - - ))} + )} + keyExtractor={(_, index) => index.toString()} + ListFooterComponent={() => } + /> - + { diff --git a/apps/mobile/app/screens/Authenticated/TaskSizeScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TaskSizeScreen/index.tsx index 57916a0e8..8bc410477 100644 --- a/apps/mobile/app/screens/Authenticated/TaskSizeScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TaskSizeScreen/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { FC, useState } from "react" -import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, ScrollView } from "react-native" +import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, FlatList } from "react-native" import { AntDesign, Ionicons } from "@expo/vector-icons" import { Screen } from "../../../components" import { AuthenticatedDrawerScreenProps } from "../../../navigators/AuthenticatedNavigator" @@ -36,8 +36,6 @@ export const TaskSizeScreen: FC return ( @@ -52,7 +50,7 @@ export const TaskSizeScreen: FC - + {translate("settingScreen.sizeScreen.listSizes")} @@ -63,23 +61,24 @@ export const TaskSizeScreen: FC {translate("settingScreen.sizeScreen.noActiveSizes")} ) : null} - {sizes?.items?.map((item, index) => ( - + + ( openForEdit(item)} onDeleteSize={() => deleteSize(item.id)} size={item} /> - - ))} + )} + keyExtractor={(_, index) => index.toString()} + ListFooterComponent={() => } + /> - + { diff --git a/apps/mobile/app/screens/Authenticated/TaskStatusScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TaskStatusScreen/index.tsx index a8a7b931c..294fee0a9 100644 --- a/apps/mobile/app/screens/Authenticated/TaskStatusScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TaskStatusScreen/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { FC, useState } from "react" -import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, ScrollView } from "react-native" +import { View, Text, ViewStyle, TouchableOpacity, StyleSheet, FlatList } from "react-native" import { AntDesign, Ionicons } from "@expo/vector-icons" import { Screen } from "../../../components" import { AuthenticatedDrawerScreenProps } from "../../../navigators/AuthenticatedNavigator" @@ -35,8 +35,6 @@ export const TaskStatusScreen: FC> // console.log("in-progress-again".replaceAll("-", " ")) return ( @@ -51,7 +49,7 @@ export const TaskStatusScreen: FC> - + {translate("settingScreen.statusScreen.listStatuses")} @@ -64,23 +62,24 @@ export const TaskStatusScreen: FC> {translate("settingScreen.statusScreen.noActiveStatuses")} ) : null} - {statuses?.items?.map((item, index) => ( - + + ( openForEdit(item)} onDeleteTask={() => deleteStatus(item.id)} status={item} /> - - ))} + )} + keyExtractor={(_, index) => index.toString()} + ListFooterComponent={() => } + /> - + { diff --git a/apps/mobile/app/screens/Authenticated/TeamScreen/components/UnassignedTaskList.tsx b/apps/mobile/app/screens/Authenticated/TeamScreen/components/UnassignedTaskList.tsx index aef5e69cb..aa1de23c3 100644 --- a/apps/mobile/app/screens/Authenticated/TeamScreen/components/UnassignedTaskList.tsx +++ b/apps/mobile/app/screens/Authenticated/TeamScreen/components/UnassignedTaskList.tsx @@ -1,8 +1,8 @@ /* eslint-disable camelcase */ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ -import React from "react" -import { StyleSheet, Text, Image, ImageStyle, TouchableOpacity } from "react-native" +import React, { FC } from "react" +import { StyleSheet, Text, Image, ImageStyle, TouchableOpacity, FlatList } from "react-native" import { spacing, typography, useAppTheme } from "../../../../theme" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" import { observer } from "mobx-react-lite" @@ -42,99 +42,110 @@ const UnassignedTasksList = observer( - {memberInfo.memberUnassignTasks.map((task: ITeamTask, index: number) => { - if (task?.status !== "closed") { - return ( - { - memberInfo?.assignTask(task) - setShowUnassignedList(false) - }} - key={index} - style={[ - styles.unassignedTaskContainer, - index === memberInfo?.memberUnassignTasks.length - 1 && { marginBottom: 10 }, - ]} - > - - - - {`#${task.taskNumber}`} - + + item?.status !== "closed" ? ( + + ) : null + } + keyExtractor={(_, index) => index.toString()} + /> + + + ) + }, +) +export default UnassignedTasksList - - {task.title} - - - - - - - - - {task.members[0]?.user?.imageUrl ? ( - - ) : null} - {task.members[1]?.user?.imageUrl ? ( - - ) : null} - - {/* {task.status === "closed" ? ( +const UnassignedTask: FC<{ + task: ITeamTask + memberInfo: I_TeamMemberCardHook + setShowUnassignedList: React.Dispatch> + index: number + colors: string +}> = ({ task, memberInfo, index, setShowUnassignedList, colors }) => { + return ( + { + memberInfo?.assignTask(task) + setShowUnassignedList(false) + }} + key={index} + style={[ + styles.unassignedTaskContainer, + index === memberInfo?.memberUnassignTasks.length - 1 && { marginBottom: 10 }, + ]} + > + + + + {`#${task.taskNumber}`} + + + + {task.title} + + + + + + + + + {task.members[0]?.user?.imageUrl ? ( + + ) : null} + {task.members[1]?.user?.imageUrl ? ( + + ) : null} + + {/* {task.status === "closed" ? ( ) : ( )} */} - - - - ) - } else return null - })} - + - ) - }, -) -export default UnassignedTasksList + + ) +} const $usersProfile: ImageStyle = { ...GS.roundedFull, @@ -188,15 +199,6 @@ const styles = StyleSheet.create({ width: "100%", zIndex: 1000, }, - wrapBugIcon: { - alignItems: "center", - backgroundColor: "#C24A4A", - borderRadius: 3, - height: 20, - justifyContent: "center", - marginRight: 3, - width: 20, - }, wrapTaskNumber: { flexDirection: "row", }, diff --git a/apps/mobile/app/screens/Authenticated/TeamScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TeamScreen/index.tsx index e755035e7..cce1c186b 100644 --- a/apps/mobile/app/screens/Authenticated/TeamScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TeamScreen/index.tsx @@ -1,8 +1,8 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ -import React, { FC, useState } from "react" +/* eslint-disable camelcase */ +import React, { FC, SetStateAction, useState } from "react" import { - ScrollView, View, TouchableOpacity, ViewStyle, @@ -10,6 +10,7 @@ import { Text, Dimensions, LogBox, + FlatList, } from "react-native" // TYPES @@ -38,6 +39,8 @@ import { useAcceptInviteModal } from "../../../services/hooks/features/useAccept import NoTeam from "../../../components/NoTeam" import VerifyAccountModal from "./components/VerifyAccount" import { useVerifyEmail } from "../../../services/hooks/features/useVerifyEmail" +import { OT_Member } from "../../../services/interfaces/IOrganizationTeam" +import { IInvitation } from "../../../services/interfaces/IInvite" const { width, height } = Dimensions.get("window") export const AuthenticatedTeamScreen: FC> = @@ -157,48 +160,45 @@ export const AuthenticatedTeamScreen: FC> = {/* Users activity list */} - - index.toString()} + renderItem={({ item, index }) => { + if (index === 0) { + return ( + + ) + } else if (index === 1) { + return ( + + ) + } else { + return ( + + ) + } }} - > - {currentUser && ( - - )} - - {$otherMembers.map((member, index) => ( - - ))} - - {teamInvitations && - teamInvitations.map((invite, idx) => ( - - ))} - - + ListFooterComponent={} + /> + ) : ( setShowCreateTeamModal(true)} /> @@ -210,13 +210,79 @@ export const AuthenticatedTeamScreen: FC> = ) } +const CurrentUserCard: FC<{ + member: OT_Member + openMenuIndex: number | null + setOpenMenuIndex: React.Dispatch> +}> = ({ member, openMenuIndex, setOpenMenuIndex }) => { + return ( + + + + ) +} + +const OtherMembersList: FC<{ + members: OT_Member[] + openMenuIndex: number | null + setOpenMenuIndex: React.Dispatch> +}> = ({ members, openMenuIndex, setOpenMenuIndex }) => { + return ( + + index.toString()} + renderItem={({ item, index }) => ( + + )} + /> + + ) +} + +const InvitationsList: FC<{ + invitations: IInvitation[] + $otherMembers: OT_Member[] + openMenuIndex: number | null + setOpenMenuIndex: React.Dispatch> +}> = ({ invitations, $otherMembers, openMenuIndex, setOpenMenuIndex }) => { + return ( + + ($otherMembers.length + index).toString()} + renderItem={({ item, index }) => ( + + )} + /> + + ) +} + const $container: ViewStyle = { ...GS.flex1, } const $cardContainer: ViewStyle = { ...GS.flex1, - paddingHorizontal: spacing.medium, + paddingHorizontal: spacing.small, } const $blurContainer: ViewStyle = { height, diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/components/ComboBox.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/components/ComboBox.tsx index 6a10a38a4..ae5534993 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/components/ComboBox.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/components/ComboBox.tsx @@ -1,10 +1,9 @@ /* eslint-disable camelcase */ /* eslint-disable react-native/no-inline-styles */ /* eslint-disable react-native/no-color-literals */ -import React, { FC } from "react" +import React, { FC, useState } from "react" import { Text } from "react-native-paper" -import { View, StyleSheet, Dimensions, TouchableWithoutFeedback, Pressable } from "react-native" -import { ScrollView } from "react-native-gesture-handler" +import { View, StyleSheet, TouchableWithoutFeedback, Pressable, FlatList } from "react-native" import { Ionicons } from "@expo/vector-icons" import TaskDisplayBox from "./TaskDisplayBox" import { observer } from "mobx-react-lite" @@ -18,10 +17,10 @@ export interface Props { closeCombo: () => unknown setEditMode: (val: boolean) => void } -const { height } = Dimensions.get("window") const ComboBox: FC = observer(function ComboBox({ tasksHandler, closeCombo, setEditMode }) { const { colors } = useAppTheme() + const [isScrolling, setIsScrolling] = useState(false) return ( @@ -54,18 +53,25 @@ const ComboBox: FC = observer(function ComboBox({ tasksHandler, closeComb /> - - {tasksHandler.filteredTasks.map((task, i) => ( - tasksHandler.handleReopenTask(task)} - task={task} - handleActiveTask={tasksHandler.setActiveTeamTask} - closeCombo={closeCombo} - setEditMode={setEditMode} - /> - ))} - + + setIsScrolling(true)} + onScrollEndDrag={() => setIsScrolling(false)} + showsVerticalScrollIndicator={false} + data={tasksHandler.filteredTasks} + renderItem={({ item, index }) => ( + tasksHandler.handleReopenTask(item)} + task={item} + isScrolling={isScrolling} + handleActiveTask={tasksHandler.setActiveTeamTask} + closeCombo={closeCombo} + setEditMode={setEditMode} + /> + )} + /> + ) @@ -96,21 +102,12 @@ const styles = StyleSheet.create({ paddingBottom: 16, width: 232, }, - loading: { - position: "absolute", - right: 10, - top: 15, - }, + mainContainer: { marginTop: 16, width: "100%", zIndex: 5, }, - wrapList: { - marginBottom: 20, - maxHeight: height / 3, - zIndex: 100, - }, }) export default ComboBox diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/components/IndividualTask.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/components/IndividualTask.tsx index a2c8c3bd0..803befa05 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/components/IndividualTask.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/components/IndividualTask.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-native/no-inline-styles */ /* eslint-disable react-native/no-color-literals */ import React, { FC, useMemo, useState } from "react" -import { View, StyleSheet, Text, Image, ImageStyle, TouchableOpacity } from "react-native" +import { View, StyleSheet, Text, ImageStyle, TouchableOpacity } from "react-native" import { Entypo, EvilIcons } from "@expo/vector-icons" import { GLOBAL_STYLE as GS } from "../../../../../assets/ts/styles" import { colors, spacing, typography, useAppTheme } from "../../../../theme" @@ -12,6 +12,8 @@ import TaskStatus from "../../../../components/TaskStatus" import { useTeamTasks } from "../../../../services/hooks/features/useTeamTasks" import IssuesModal from "../../../../components/IssuesModal" import { limitTextCharaters } from "../../../../helpers/sub-text" +import { Avatar } from "react-native-paper" +import { imgTitleProfileAvatar } from "../../../../helpers/img-title-profile-avatar" export interface Props { task: ITeamTask @@ -19,10 +21,11 @@ export interface Props { closeCombo?: () => unknown onReopenTask: () => unknown setEditMode: (val: boolean) => void + isScrolling: boolean } const IndividualTask: FC = observer( - ({ task, handleActiveTask, closeCombo, onReopenTask, setEditMode }) => { + ({ task, handleActiveTask, closeCombo, onReopenTask, setEditMode, isScrolling }) => { const { colors } = useAppTheme() const [showDel, setShowDel] = useState(false) const { updateTask } = useTeamTasks() @@ -52,7 +55,7 @@ const IndividualTask: FC = observer( > { - handleActiveTask(task) + !isScrolling && handleActiveTask(task) }} // added it here because doesn't work when assigned to the parent style={{ flexDirection: "row", @@ -74,7 +77,7 @@ const IndividualTask: FC = observer( { - handleActiveTask(task) + !isScrolling && handleActiveTask(task) }} // added it here because doesn't work when assigned to the parent style={{ flexDirection: "row", @@ -96,11 +99,29 @@ const IndividualTask: FC = observer( }} > - {assigneeImg1 ? : null} + {assigneeImg1 ? ( + + ) : task.members[0] ? ( + + ) : null} + {assigneeImg2 ? ( - + + ) : task.members[1] ? ( + ) : null} + {task.status === "closed" ? ( onReopenTask()} /> ) : ( @@ -133,6 +154,11 @@ const styles = StyleSheet.create({ width: "100%", zIndex: 1000, }, + prefix: { + color: "#FFFFFF", + fontFamily: typography.fonts.PlusJakartaSans.light, + fontSize: 20, + }, statusContainer: { alignItems: "center", backgroundColor: "#ECE8FC", diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/index.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/index.tsx index 42e05ae29..94610fbcc 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/index.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/index.tsx @@ -45,8 +45,6 @@ export const AuthenticatedTimerScreen: FC> return ( = observer( {translate("loginScreen.selectWorkspaceFieldLabel")} - - {workspaceData?.map((workspace: IWorkspace, i: number) => ( + + ( = observer( setIsValid={setIsValid} setTempAuthToken={setTempAuthToken} /> - ))} - + )} + /> )} diff --git a/apps/mobile/app/screens/LoginScreen/Components/UserTenants.tsx b/apps/mobile/app/screens/LoginScreen/Components/UserTenants.tsx index 1a8448c80..db1522c52 100644 --- a/apps/mobile/app/screens/LoginScreen/Components/UserTenants.tsx +++ b/apps/mobile/app/screens/LoginScreen/Components/UserTenants.tsx @@ -2,7 +2,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-unused-styles */ import React, { FC } from "react" -import { View, Text, StyleSheet, Image } from "react-native" +import { View, Text, StyleSheet, Image, FlatList } from "react-native" import { IWorkspace } from "../../../services/interfaces/IAuthentication" import { SvgXml } from "react-native-svg" import { grayCircleIcon, greenCircleTickIcon } from "../../../components/svgs/icons" @@ -57,33 +57,37 @@ const UserTenants: FC = ({ - {data.current_teams.map((team, i) => ( - - - - - {team.team_name}({team.team_member_count}) - + ( + + + + + {item.team_name}({item.team_member_count}) + + + { + setActiveTeamId(item.team_id) + setSelectedWorkspace(index) + setIsValid({ ...isValid, step3: true }) + setTempAuthToken(data.token) + }} + > + {activeTeamId === item.team_id ? ( + + ) : ( + + )} + - { - setActiveTeamId(team.team_id) - setSelectedWorkspace(index) - setIsValid({ ...isValid, step3: true }) - setTempAuthToken(data.token) - }} - > - {activeTeamId === team.team_id ? ( - - ) : ( - - )} - - - ))} + )} + keyExtractor={(item, index) => index.toString()} + /> ) diff --git a/apps/mobile/app/screens/LoginScreen/index.tsx b/apps/mobile/app/screens/LoginScreen/index.tsx index 31ca63471..7b8a81e16 100644 --- a/apps/mobile/app/screens/LoginScreen/index.tsx +++ b/apps/mobile/app/screens/LoginScreen/index.tsx @@ -42,12 +42,10 @@ export const LoginScreen: FC = observer(function LoginScreen(_ return (