Skip to content

Commit

Permalink
add easing to effect
Browse files Browse the repository at this point in the history
  • Loading branch information
sumo-slonik committed Dec 20, 2024
1 parent 408750f commit be4015e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import type {SharedValue} from 'react-native-reanimated';
import Animated, {useAnimatedStyle, useDerivedValue, useSharedValue, withTiming} from 'react-native-reanimated';
import Animated, {Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming} from 'react-native-reanimated';
import useThemeStyles from '@hooks/useThemeStyles';

type AccordionProps = {
Expand All @@ -27,12 +27,14 @@ function Accordion({isExpanded, children, duration = 300, style}: AccordionProps
const derivedHeight = useDerivedValue(() =>
withTiming(height.value * Number(isExpanded.value), {

Check failure on line 28 in src/components/Accordion/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'value' is deprecated. Use the new `.get()` and `.set(value)` methods instead

Check failure on line 28 in src/components/Accordion/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'value' is deprecated. Use the new `.get()` and `.set(value)` methods instead
duration,
easing: Easing.inOut(Easing.quad),
}),
);

const derivedOpacity = useDerivedValue(() =>
withTiming(isExpanded.value ? 1 : 0, {

Check failure on line 35 in src/components/Accordion/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'value' is deprecated. Use the new `.get()` and `.set(value)` methods instead
duration,
easing: Easing.inOut(Easing.quad),
}),
);

Expand Down

0 comments on commit be4015e

Please sign in to comment.