File tree 3 files changed +27
-14
lines changed
3 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,16 @@ const styles = StyleSheet.create({
30
30
} ,
31
31
} ) ;
32
32
33
+ type SelectorProps = { |
34
+ unreadCount : number ,
35
+ | } ;
36
+
33
37
type Props = { |
34
- dispatch : Dispatch ,
35
38
limited : boolean ,
36
39
narrow : Narrow ,
37
- unreadCount : number ,
40
+
41
+ dispatch : Dispatch ,
42
+ ...SelectorProps ,
38
43
| } ;
39
44
40
45
class UnreadNotice extends PureComponent < Props > {
@@ -65,6 +70,6 @@ class UnreadNotice extends PureComponent<Props> {
65
70
}
66
71
}
67
72
68
- export default connect ( ( state , props ) => ( {
73
+ export default connect ( ( state , props ) : SelectorProps => ( {
69
74
unreadCount : getUnreadCountForNarrow ( state , props . narrow ) ,
70
75
} ) ) ( UnreadNotice ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import type {
12
12
UserOrBot ,
13
13
Dispatch ,
14
14
Dimensions ,
15
- GlobalState ,
16
15
} from '../types' ;
17
16
import { connect } from '../react-redux' ;
18
17
import {
@@ -47,18 +46,22 @@ import { getDraftForNarrow } from '../drafts/draftsSelectors';
47
46
import TopicAutocomplete from '../autocomplete/TopicAutocomplete' ;
48
47
import AutocompleteView from '../autocomplete/AutocompleteView' ;
49
48
50
- type Props = { |
49
+ type SelectorProps = { |
51
50
auth : Auth ,
52
- narrow : Narrow ,
53
51
usersByEmail : Map < string , UserOrBot> ,
54
- draft : string ,
55
- lastMessageTopic : string ,
52
+ safeAreaInsets : Dimensions ,
56
53
isAdmin : boolean ,
57
54
isAnnouncementOnly : boolean ,
58
55
isSubscribed : boolean ,
59
56
editMessage : ?EditMessage ,
60
- safeAreaInsets : Dimensions ,
57
+ draft : string ,
58
+ lastMessageTopic : string ,
59
+ | } ;
60
+
61
+ type Props = { |
62
+ narrow : Narrow ,
61
63
dispatch : Dispatch ,
64
+ ...SelectorProps ,
62
65
| } ;
63
66
64
67
type State = { |
@@ -402,7 +405,7 @@ class ComposeBox extends PureComponent<Props, State> {
402
405
}
403
406
}
404
407
405
- export default connect ( ( state : GlobalState , props ) => ( {
408
+ export default connect ( ( state , props ) : SelectorProps => ( {
406
409
auth : getAuth ( state ) ,
407
410
usersByEmail : getActiveUsersByEmail ( state ) ,
408
411
safeAreaInsets : getSession ( state ) . safeAreaInsets ,
Original file line number Diff line number Diff line change 3
3
import React , { PureComponent } from 'react' ;
4
4
import { View } from 'react-native' ;
5
5
6
- import type { Dispatch , GlobalState , Narrow } from '../types' ;
6
+ import type { Dispatch , Narrow } from '../types' ;
7
7
import { connect } from '../react-redux' ;
8
8
import styles , { BRAND_COLOR } from '../styles' ;
9
9
import Title from '../title/Title' ;
@@ -13,10 +13,15 @@ import { foregroundColorFromBackground } from '../utils/color';
13
13
import { navigateBack } from '../actions' ;
14
14
import { ExtraButton , InfoButton } from '../title-buttons/titleButtonFromNarrow' ;
15
15
16
- type Props = { |
17
- dispatch : Dispatch ,
16
+ type SelectorProps = { |
18
17
backgroundColor : string ,
18
+ | } ;
19
+
20
+ type Props = { |
19
21
narrow : Narrow ,
22
+
23
+ dispatch : Dispatch ,
24
+ ...SelectorProps ,
20
25
| } ;
21
26
22
27
class ChatNavBar extends PureComponent < Props > {
@@ -44,6 +49,6 @@ class ChatNavBar extends PureComponent<Props> {
44
49
}
45
50
}
46
51
47
- export default connect ( ( state : GlobalState , props ) => ( {
52
+ export default connect ( ( state , props ) : SelectorProps => ( {
48
53
backgroundColor : getTitleBackgroundColor ( props . narrow ) ( state ) ,
49
54
} ) ) ( ChatNavBar ) ;
You can’t perform that action at this time.
0 commit comments