fix(mobile): optimize animation cancellation and UI styling
- Add `cancelAnimation` to prevent animation conflicts in SubmitButton and Tabbar - Adjust Tabbar animation duration for smoother transitions - Update email login background color to use secondary system background Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useEffect } from "react"
|
||||
import type { PressableProps } from "react-native"
|
||||
import { ActivityIndicator } from "react-native"
|
||||
import Animated, {
|
||||
cancelAnimation,
|
||||
interpolateColor,
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
@@ -25,6 +26,7 @@ export function SubmitButton({
|
||||
|
||||
const disabledValue = useSharedValue(1)
|
||||
useEffect(() => {
|
||||
cancelAnimation(disabledValue)
|
||||
disabledValue.value = withTiming(props.disabled ? 1 : 0)
|
||||
}, [props.disabled])
|
||||
|
||||
|
||||
@@ -163,7 +163,8 @@ const TextLabel = (props: {
|
||||
color: interpolateColor(focusedValue.value, [0, 1], [inactiveTintColor, accentColor]),
|
||||
}))
|
||||
useEffect(() => {
|
||||
focusedValue.value = withSpring(focused ? 1 : 0)
|
||||
cancelAnimation(focusedValue)
|
||||
focusedValue.value = withSpring(focused ? 1 : 0, { duration: 100 })
|
||||
}, [focused, focusedValue])
|
||||
return (
|
||||
<Animated.Text
|
||||
|
||||
@@ -81,7 +81,7 @@ export function EmailLogin() {
|
||||
|
||||
return (
|
||||
<View className="mx-auto flex w-full max-w-sm gap-6">
|
||||
<View className="bg-system-grouped-background gap-4 rounded-2xl px-6 py-4">
|
||||
<View className="bg-secondary-system-background gap-4 rounded-2xl px-6 py-4">
|
||||
<View className="flex-row">
|
||||
<Input
|
||||
autoCapitalize="none"
|
||||
|
||||
Reference in New Issue
Block a user