|
@@ -2,17 +2,18 @@
|
2
|
2
|
|
3
|
3
|
import * as React from 'react';
|
4
|
4
|
import {StyleSheet, View} from "react-native";
|
5
|
|
-import {FAB, IconButton, Surface, withTheme} from "react-native-paper";
|
|
5
|
+import {FAB, IconButton, Surface, Theme, withTheme} from "react-native-paper";
|
6
|
6
|
import AutoHideHandler from "../../utils/AutoHideHandler";
|
7
|
7
|
import * as Animatable from 'react-native-animatable';
|
8
|
8
|
import CustomTabBar from "../Tabbar/CustomTabBar";
|
|
9
|
+import {StackNavigationProp} from "@react-navigation/stack";
|
9
|
10
|
|
10
|
11
|
const AnimatedFAB = Animatable.createAnimatableComponent(FAB);
|
11
|
12
|
|
12
|
13
|
type Props = {
|
13
|
|
- navigation: Object,
|
14
|
|
- theme: Object,
|
15
|
|
- onPress: Function,
|
|
14
|
+ navigation: StackNavigationProp,
|
|
15
|
+ theme: Theme,
|
|
16
|
+ onPress: (action: string, data: any) => void,
|
16
|
17
|
seekAttention: boolean,
|
17
|
18
|
}
|
18
|
19
|
|
|
@@ -28,10 +29,10 @@ const DISPLAY_MODES = {
|
28
|
29
|
|
29
|
30
|
class AnimatedBottomBar extends React.Component<Props, State> {
|
30
|
31
|
|
31
|
|
- ref: Object;
|
|
32
|
+ ref: { current: null | Animatable.View };
|
32
|
33
|
hideHandler: AutoHideHandler;
|
33
|
34
|
|
34
|
|
- displayModeIcons: Object;
|
|
35
|
+ displayModeIcons: { [key: string]: string };
|
35
|
36
|
|
36
|
37
|
state = {
|
37
|
38
|
currentMode: DISPLAY_MODES.WEEK,
|
|
@@ -55,7 +56,7 @@ class AnimatedBottomBar extends React.Component<Props, State> {
|
55
|
56
|
}
|
56
|
57
|
|
57
|
58
|
onHideChange = (shouldHide: boolean) => {
|
58
|
|
- if (this.ref.current) {
|
|
59
|
+ if (this.ref.current != null) {
|
59
|
60
|
if (shouldHide)
|
60
|
61
|
this.ref.current.bounceOutDown(1000);
|
61
|
62
|
else
|
|
@@ -63,7 +64,7 @@ class AnimatedBottomBar extends React.Component<Props, State> {
|
63
|
64
|
}
|
64
|
65
|
}
|
65
|
66
|
|
66
|
|
- onScroll = (event: Object) => {
|
|
67
|
+ onScroll = (event: SyntheticEvent<EventTarget>) => {
|
67
|
68
|
this.hideHandler.onScroll(event);
|
68
|
69
|
};
|
69
|
70
|
|