Skip to content

Commit

Permalink
Update AutocompleteDropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 18, 2024
1 parent f85e6c1 commit 10266f0
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export const AutocompleteDropdownContextProvider: FC<IAutocompleteDropdownContex
topY: inputPageY - wrapperPageY,
bottomY: wrapperH - inputPageY + wrapperPageY,
}
setInputMeasurements(prev =>
JSON.stringify(prev) === JSON.stringify(currentMeasurement) ? prev : currentMeasurement,
)
setInputMeasurements((prev) =>
(JSON.stringify(prev) === JSON.stringify(currentMeasurement) ? prev : currentMeasurement),)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
showAfterCalculation && setShow(true)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ interface WithFadeAnimationProps {
export const withFadeAnimation = <P extends object>(
WrappedComponent: ComponentType<P>,
{ containerStyle }: WithFadeAnimationProps = {},
): FC<P> => {
return (props: P) => {
const opacityAnimationValue = useRef(new Animated.Value(0)).current
// eslint-disable-next-line react/display-name
): FC<P> => function (props: P) {
const opacityAnimationValue = useRef(new Animated.Value(0)).current

useEffect(() => {
Animated.timing(opacityAnimationValue, {
duration: 800,
toValue: 1,
useNativeDriver: true,
easing: Easing.bezier(0.3, 0.58, 0.25, 0.99),
}).start()
}, [opacityAnimationValue])
useEffect(() => {
Animated.timing(opacityAnimationValue, {
duration: 800,
toValue: 1,
useNativeDriver: true,
easing: Easing.bezier(0.3, 0.58, 0.25, 0.99),
}).start()
}, [opacityAnimationValue])

return (
<Animated.View style={[containerStyle, { opacity: opacityAnimationValue }]}>
<WrappedComponent {...props} />
</Animated.View>
)
}
return (
<Animated.View style={[containerStyle, { opacity: opacityAnimationValue }]}>
<WrappedComponent {...props} />
</Animated.View>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface NothingFoundProps {
emptyResultText?: string
}

// eslint-disable-next-line react/display-name
export const NothingFound: FC<NothingFoundProps> = memo(({ ...props }) => {
const EL = withFadeAnimation(
() => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unsafe-optional-chaining */
import type { FC } from 'react'
import React, { memo, useMemo } from 'react'
import type { ViewProps } from 'react-native'
Expand All @@ -14,6 +15,7 @@ interface ScrollViewListItemProps {
numberOfLines?: number
}

// eslint-disable-next-line react/display-name
export const ScrollViewListItem: FC<ScrollViewListItemProps> = memo(
({ highlight, title, style, onPress, ignoreAccents, numberOfLines = 2 }) => {
const themeName = useColorScheme()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,12 @@ const diacritics: DiacriticsMap = {
export default function removeDiacritics(text: string): string {
const result: string[] = []

// eslint-disable-next-line no-plusplus
for (let i = 0; i < text.length; i++) {
const searchChar = text.charAt(i)
let foundChar = false

// eslint-disable-next-line guard-for-in
for (const key in diacritics) {
const index = diacritics[key]?.indexOf(searchChar)
if (index !== -1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-shadow */
declare global {
namespace setInterval {
function setInterval(callback: () => void, ms?: number | undefined): NodeJS.Timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function useKeyboardHeight() {
const [keyboardHeight, setKeyboardHeight] = useState(0)

useEffect(() => {
const showSubscription = Keyboard.addListener('keyboardDidShow', e => setKeyboardHeight(e.endCoordinates.height))
const showSubscription = Keyboard.addListener('keyboardDidShow', (e) => setKeyboardHeight(e.endCoordinates.height))
const hideSubscription = Keyboard.addListener('keyboardDidHide', () => setKeyboardHeight(0))
return () => {
showSubscription.remove()
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/Booking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Booking = ({
}

init()
}, [booking, car.additionalDriver, car.amendments, car.cancellation, car.collisionDamageWaiver, car.fullInsurance, car.theftProtection, days, language])
}, [booking, car, days, language])

return !loading && price && (
<View key={booking._id} style={styles.bookingContainer}>
Expand Down

0 comments on commit 10266f0

Please sign in to comment.