Skip to content

Commit 2ee0905

Browse files
committed
updated
1 parent e68cfb8 commit 2ee0905

File tree

12 files changed

+92
-72
lines changed

12 files changed

+92
-72
lines changed

ios/cloudbeds.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@
586586
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
587587
CLANG_ENABLE_MODULES = YES;
588588
CODE_SIGN_ENTITLEMENTS = cloudbeds/cloudbeds.entitlements;
589-
CURRENT_PROJECT_VERSION = 12;
589+
CURRENT_PROJECT_VERSION = 13;
590590
DEVELOPMENT_TEAM = 45V8A9SP6B;
591591
ENABLE_BITCODE = NO;
592592
INFOPLIST_FILE = cloudbeds/Info.plist;
@@ -616,7 +616,7 @@
616616
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
617617
CLANG_ENABLE_MODULES = YES;
618618
CODE_SIGN_ENTITLEMENTS = cloudbeds/cloudbeds.entitlements;
619-
CURRENT_PROJECT_VERSION = 12;
619+
CURRENT_PROJECT_VERSION = 13;
620620
DEVELOPMENT_TEAM = 45V8A9SP6B;
621621
INFOPLIST_FILE = cloudbeds/Info.plist;
622622
LD_RUNPATH_SEARCH_PATHS = (

ios/cloudbeds/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</dict>
3434
</array>
3535
<key>CFBundleVersion</key>
36-
<string>12</string>
36+
<string>13</string>
3737
<key>ITSAppUsesNonExemptEncryption</key>
3838
<false/>
3939
<key>LSRequiresIPhoneOS</key>

src/Components/BottomTabNavigation/BottomTabNavigation.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,27 @@ const BottomTabNavigation = ({ state, descriptors, navigation, insets }) => {
4646
})
4747

4848
return (
49-
<Box key={route.key} flex={1} alignItems={'center'}>
50-
<Box
51-
p="2"
52-
rounded="lg"
53-
borderColor={isFocused ? 'primary.500' : 'white'}
54-
bg={isFocused ? 'primary.50' : null}
55-
borderWidth="1">
56-
<TouchableOpacity
57-
accessibilityRole="button"
58-
accessibilityState={isFocused ? { selected: true } : {}}
59-
accessibilityLabel={options.tabBarAccessibilityLabel}
60-
testID={options.tabBarTestID}
61-
onPress={onPress}
62-
onLongPress={onLongPress}>
49+
<TouchableOpacity
50+
key={route.key}
51+
accessibilityRole="button"
52+
accessibilityState={isFocused ? { selected: true } : {}}
53+
accessibilityLabel={options.tabBarAccessibilityLabel}
54+
testID={options.tabBarTestID}
55+
// eslint-disable-next-line react-native/no-inline-styles
56+
style={{ flex: 1 }}
57+
onPress={onPress}
58+
onLongPress={onLongPress}>
59+
<Box alignItems={'center'}>
60+
<Box
61+
p="2"
62+
rounded="lg"
63+
borderColor={isFocused ? 'primary.500' : 'white'}
64+
bg={isFocused ? 'primary.50' : null}
65+
borderWidth="1">
6366
<Square size="8">{icon}</Square>
64-
</TouchableOpacity>
67+
</Box>
6568
</Box>
66-
</Box>
69+
</TouchableOpacity>
6770
)
6871
})}
6972
</Box>

src/Hooks/api/useRefetchOnFocus.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/Hooks/api/useRefetchOnFocus.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { useCallback, useRef } from 'react'
2+
import { InteractionManager } from 'react-native'
3+
import { useFocusEffect } from '@react-navigation/native'
4+
5+
export function useRefreshOnFocus(refetch: () => void) {
6+
const enabledRef = useRef(false)
7+
8+
useFocusEffect(
9+
useCallback(() => {
10+
InteractionManager.runAfterInteractions(() => {
11+
if (enabledRef.current) {
12+
refetch()
13+
} else {
14+
enabledRef.current = true
15+
}
16+
})
17+
}, [refetch]),
18+
)
19+
}

src/Hooks/useUser.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,9 @@ export default function useUser(refresh = false) {
105105
hideProgress()
106106
}
107107
},
108-
[
109-
changeCurrentProperty,
110-
changeProperties,
111-
changeUserInfo,
112-
hideProgress,
113-
showProgress,
114-
],
108+
109+
// eslint-disable-next-line react-hooks/exhaustive-deps
110+
[changeCurrentProperty, changeProperties, changeUserInfo],
115111
)
116112

117113
const clearTimers = useCallback(() => {

src/Navigation/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export const headerLeft = (
2323

2424
return (
2525
<Pressable
26-
width={8}
26+
width={12}
2727
height={10}
28-
alignItems={'flex-end'}
28+
alignItems={'center'}
2929
justifyContent={'center'}
3030
onPress={backPress}>
3131
<FontAwesomeIcon icon={faChevronLeft as Icon} size={16} />

src/Screens/AddNote/index.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo, useState } from 'react'
1+
import React, { memo, useCallback, useMemo, useState } from 'react'
22
import { Keyboard } from 'react-native'
33
import {
44
Actionsheet,
@@ -136,7 +136,9 @@ function AddNote() {
136136
placement: 'top',
137137
showClose: true,
138138
})
139-
}, [hideProgress, showToast])
139+
140+
// eslint-disable-next-line react-hooks/exhaustive-deps
141+
}, [showToast])
140142

141143
const successProcess = useCallback(
142144
(data: any, message: string) => {
@@ -155,7 +157,9 @@ function AddNote() {
155157
noteSussess(message)
156158
}
157159
},
158-
[hideProgress, noteSussess, showToast],
160+
161+
// eslint-disable-next-line react-hooks/exhaustive-deps
162+
[noteSussess, showToast],
159163
)
160164

161165
const updateNote = useCallback(() => {
@@ -236,14 +240,9 @@ function AddNote() {
236240
} else {
237241
sendReservationNote()
238242
}
239-
}, [
240-
isGuest,
241-
selectedNote,
242-
sendGuestNote,
243-
sendReservationNote,
244-
showProgress,
245-
updateNote,
246-
])
243+
244+
// eslint-disable-next-line react-hooks/exhaustive-deps
245+
}, [isGuest, selectedNote, sendGuestNote, sendReservationNote, updateNote])
247246

248247
const reservationNoteDelete = useCallback(() => {
249248
deleteReservationNote(
@@ -302,13 +301,9 @@ function AddNote() {
302301
} else {
303302
reservationNoteDelete()
304303
}
305-
}, [
306-
guestNoteDelete,
307-
isGuest,
308-
onCloseDot,
309-
reservationNoteDelete,
310-
showProgress,
311-
])
304+
305+
// eslint-disable-next-line react-hooks/exhaustive-deps
306+
}, [guestNoteDelete, isGuest, onCloseDot, reservationNoteDelete])
312307

313308
const openDot = useCallback(
314309
(item: ReservationNotesProps) => {
@@ -466,4 +461,4 @@ function AddNote() {
466461
)
467462
}
468463

469-
export default AddNote
464+
export default memo(AddNote)

src/Screens/Dashboard/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useCallback, useState } from 'react'
2-
import { RefreshControl } from 'react-native'
2+
import { InteractionManager, RefreshControl } from 'react-native'
33
import { useNavigation } from '@react-navigation/native'
44
import { Box, Text, VStack, ScrollView, HStack } from 'native-base'
55
import { AnimatedCircularProgress } from 'react-native-circular-progress'
@@ -37,7 +37,13 @@ function Dashboard() {
3737
const response = data ? data.data : {}
3838
const { arrivals, departures, inHouse, percentageOccupied } = response
3939

40-
useRefreshOnFocus(refetch)
40+
const refetchs = useCallback(() => {
41+
InteractionManager.runAfterInteractions(() => {
42+
refetch()
43+
})
44+
}, [refetch])
45+
46+
useRefreshOnFocus(refetchs)
4147

4248
const refetchAll = useCallback(() => {
4349
refetchAllReservations()

src/Screens/Housekeeping/Rooms.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ function Rooms() {
175175
noteSussess('')
176176
}
177177
},
178-
[closeFilter, hideProgress, housekeepingFilters, noteSussess, showToast],
178+
179+
// eslint-disable-next-line react-hooks/exhaustive-deps
180+
[closeFilter, housekeepingFilters, noteSussess, showToast],
179181
)
180182

181183
const errorProcess = useCallback(() => {
@@ -187,7 +189,9 @@ function Rooms() {
187189
placement: 'top',
188190
showClose: true,
189191
})
190-
}, [hideProgress, showToast])
192+
193+
// eslint-disable-next-line react-hooks/exhaustive-deps
194+
}, [showToast])
191195

192196
const setHousekeepingStatus = useCallback(
193197
(params: any) => {
@@ -202,7 +206,9 @@ function Rooms() {
202206
},
203207
})
204208
},
205-
[errorProcess, postHousekeepingStatus, showProgress, successProcess],
209+
210+
// eslint-disable-next-line react-hooks/exhaustive-deps
211+
[errorProcess, postHousekeepingStatus, successProcess],
206212
)
207213

208214
const changeDisturb = useCallback(
@@ -253,13 +259,14 @@ function Rooms() {
253259
)
254260
}
255261
},
262+
263+
// eslint-disable-next-line react-hooks/exhaustive-deps
256264
[
257265
errorProcess,
258266
housekeepingStatus?.roomID,
259267
postHousekeepingAssignment,
260268
sFilters,
261269
setHousekeepingStatus,
262-
showProgress,
263270
showToast,
264271
successProcess,
265272
],

0 commit comments

Comments
 (0)