Matthias Nott
2026-03-08 4c266155785aad5050ebff7211e3d5f9e15c3238
components/ui/IncomingToast.tsx
....@@ -13,22 +13,24 @@
1313
1414 export function IncomingToast({ sessionName, preview, onTap, onDismiss }: IncomingToastProps) {
1515 const { colors } = useTheme();
16
- const opacity = useRef(new Animated.Value(0)).current;
17
- const translateY = useRef(new Animated.Value(-40)).current;
16
+ const translateY = useRef(new Animated.Value(-60)).current;
1817
1918 useEffect(() => {
20
- // Slide in
21
- Animated.parallel([
22
- Animated.timing(opacity, { toValue: 1, duration: 200, useNativeDriver: true }),
23
- Animated.timing(translateY, { toValue: 0, duration: 200, useNativeDriver: true }),
24
- ]).start();
19
+ // Slide in from above (no opacity — keeps background solid)
20
+ Animated.spring(translateY, {
21
+ toValue: 0,
22
+ useNativeDriver: true,
23
+ tension: 80,
24
+ friction: 10,
25
+ }).start();
2526
2627 // Auto-dismiss
2728 const timer = setTimeout(() => {
28
- Animated.parallel([
29
- Animated.timing(opacity, { toValue: 0, duration: 200, useNativeDriver: true }),
30
- Animated.timing(translateY, { toValue: -40, duration: 200, useNativeDriver: true }),
31
- ]).start(() => onDismiss());
29
+ Animated.timing(translateY, {
30
+ toValue: -60,
31
+ duration: 200,
32
+ useNativeDriver: true,
33
+ }).start(() => onDismiss());
3234 }, DISPLAY_MS);
3335
3436 return () => clearTimeout(timer);
....@@ -38,11 +40,10 @@
3840 <Animated.View
3941 style={{
4042 position: "absolute",
41
- top: 0,
43
+ top: 4,
4244 left: 12,
4345 right: 12,
4446 zIndex: 100,
45
- opacity,
4647 transform: [{ translateY }],
4748 }}
4849 >
....@@ -57,31 +58,31 @@
5758 borderRadius: 12,
5859 backgroundColor: pressed ? colors.bgTertiary : colors.bgSecondary,
5960 borderWidth: 1,
60
- borderColor: colors.border,
61
+ borderColor: colors.accent,
6162 shadowColor: "#000",
62
- shadowOffset: { width: 0, height: 2 },
63
- shadowOpacity: 0.25,
64
- shadowRadius: 4,
65
- elevation: 5,
63
+ shadowOffset: { width: 0, height: 4 },
64
+ shadowOpacity: 0.4,
65
+ shadowRadius: 8,
66
+ elevation: 8,
6667 })}
6768 >
6869 <View
6970 style={{
70
- width: 8,
71
- height: 8,
72
- borderRadius: 4,
73
- backgroundColor: "#3b82f6",
71
+ width: 10,
72
+ height: 10,
73
+ borderRadius: 5,
74
+ backgroundColor: colors.accent,
7475 }}
7576 />
7677 <View style={{ flex: 1 }}>
77
- <Text style={{ color: colors.text, fontSize: 13, fontWeight: "700" }} numberOfLines={1}>
78
+ <Text style={{ color: colors.text, fontSize: 14, fontWeight: "700" }} numberOfLines={1}>
7879 {sessionName}
7980 </Text>
80
- <Text style={{ color: colors.textMuted, fontSize: 12, marginTop: 1 }} numberOfLines={1}>
81
+ <Text style={{ color: colors.textMuted, fontSize: 12, marginTop: 2 }} numberOfLines={1}>
8182 {preview}
8283 </Text>
8384 </View>
84
- <Text style={{ color: colors.textMuted, fontSize: 11 }}>tap to switch</Text>
85
+ <Text style={{ color: colors.accent, fontSize: 11, fontWeight: "600" }}>switch</Text>
8586 </Pressable>
8687 </Animated.View>
8788 );