From b0cc238b20d5d4dc3b0235b6cc149645833d38a2 Mon Sep 17 00:00:00 2001 From: desperado1802 Date: Fri, 24 Nov 2023 16:12:27 +0200 Subject: [PATCH] fixed profile screen card shadow for androids, also fixed estimate mode exit --- .../ProfileScreen/components/ListCardItem.tsx | 2 +- .../TeamScreen/components/ListCardItem.tsx | 69 +++++++++++-------- .../TimerScreen/components/EstimateTime.tsx | 21 ++---- 3 files changed, 45 insertions(+), 47 deletions(-) diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx index 1a64862f0..226e6cecd 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx @@ -315,7 +315,7 @@ export default ListCardItem; const styles = StyleSheet.create({ cardContainer: { borderRadius: 14, - elevation: 24, + elevation: 5, shadowColor: '#000', shadowOffset: { width: 0, height: 12 }, shadowOpacity: 0.05, diff --git a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx index d2a526455..55f90ce24 100644 --- a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx @@ -2,7 +2,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { useState } from 'react'; -import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback } from 'react-native'; +import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback, Platform } from 'react-native'; import { Ionicons, Entypo } from '@expo/vector-icons'; // COMPONENTS @@ -32,6 +32,7 @@ import { translate } from '../../../../i18n'; import { useTimer } from '../../../../services/hooks/useTimer'; import { SettingScreenNavigationProp } from '../../../../navigators/AuthenticatedNavigator'; import { getTimerStatusValue } from '../../../../helpers/get-timer-status'; +import { useClickOutside } from 'react-native-click-outside'; export type ListItemProps = { member: OT_Member; @@ -54,6 +55,7 @@ export interface Props extends ListItemProps { export const ListItemContent: React.FC = observer(({ memberInfo, taskEdition, onPressIn }) => { // HOOKS const { colors, dark } = useAppTheme(); + const clickOutsideTaskEstimationInputRef = useClickOutside(() => taskEdition.setEstimateEditMode(false)); return ( = observer(({ memberInfo, - { + if (Platform.OS === 'android' && taskEdition.estimateEditMode) { + event.stopPropagation(); + taskEdition.setEstimateEditMode(false); + } }} > - - - + + + + - - - + + + - {memberInfo.memberTask && taskEdition.estimateEditMode ? ( - - + + + ) : ( + taskEdition.setEstimateEditMode(true)} /> - - ) : ( - taskEdition.setEstimateEditMode(true)} - /> - )} - + )} + + @@ -353,7 +365,6 @@ const styles = StyleSheet.create({ }, estimate: { alignItems: 'center', - backgroundColor: '#E8EBF8', borderRadius: 5, flexDirection: 'row', justifyContent: 'space-between', diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/components/EstimateTime.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/components/EstimateTime.tsx index 659d9c4ef..69faf6040 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/components/EstimateTime.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/components/EstimateTime.tsx @@ -174,15 +174,7 @@ const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime {' m'} - {showCheckIcon && ( - handleSubmit()} - /> - )} + {showCheckIcon && handleSubmit()} />} {isLoading ? : null} ); @@ -197,8 +189,8 @@ const styles = StyleSheet.create({ borderRadius: 8, flexDirection: 'row', justifyContent: 'space-between', - marginLeft: 'auto', - marginRight: 10 + marginLeft: 'auto' + // marginRight: 10 }, estimateInput: { fontFamily: typography.fonts.PlusJakartaSans.semiBold, @@ -207,16 +199,11 @@ const styles = StyleSheet.create({ textAlign: 'center' }, loading: { - position: 'absolute', - right: -18 + marginLeft: 2 }, suffix: { fontFamily: typography.fonts.PlusJakartaSans.semiBold, fontSize: 14 }, - thickIconStyle: { - position: 'absolute', - right: -26 - }, wrapDash: { flexDirection: 'row', justifyContent: 'space-between', paddingLeft: 2 } });