@@ -5,15 +5,17 @@ import type { NavigationScreenProp } from 'react-navigation';
5
5
import { ActionSheetProvider } from '@expo/react-native-action-sheet' ;
6
6
7
7
import { connect } from '../react-redux' ;
8
- import type { Context , Dispatch , Fetching , Narrow } from '../types' ;
8
+ import type { ThemeColors } from '../styles' ;
9
+ import styles , { ThemeContext } from '../styles' ;
10
+ import type { Dispatch , Fetching , Narrow } from '../types' ;
9
11
import { KeyboardAvoider , OfflineNotice , ZulipStatusBar } from '../common' ;
10
12
import ChatNavBar from '../nav/ChatNavBar' ;
11
13
12
14
import MessageList from '../webview/MessageList' ;
13
15
import NoMessages from '../message/NoMessages' ;
14
16
import ComposeBox from '../compose/ComposeBox' ;
15
17
import UnreadNotice from './UnreadNotice' ;
16
- import styles from '../styles' ;
18
+
17
19
import { canSendToNarrow } from '../utils/narrow' ;
18
20
import { getLoading } from '../directSelectors' ;
19
21
import { getFetchingForNarrow } from './fetchingSelectors' ;
@@ -33,6 +35,10 @@ type Props = $ReadOnly<{|
33
35
| } > ;
34
36
35
37
const componentStyles = StyleSheet . create ( {
38
+ screen : {
39
+ flex : 1 ,
40
+ flexDirection : 'column' ,
41
+ } ,
36
42
/** A workaround for #3089, by letting us put MessageList first. */
37
43
reverse : {
38
44
flex : 1 ,
@@ -41,14 +47,10 @@ const componentStyles = StyleSheet.create({
41
47
} ) ;
42
48
43
49
class ChatScreen extends PureComponent < Props > {
44
- context : Context ;
45
-
46
- static contextTypes = {
47
- styles : ( ) => null ,
48
- } ;
50
+ static contextType = ThemeContext ;
51
+ context : ThemeColors ;
49
52
50
53
render ( ) {
51
- const { styles : contextStyles } = this . context ;
52
54
const { fetching, haveNoMessages, loading, navigation } = this . props ;
53
55
const { narrow } = navigation . state . params ;
54
56
@@ -59,7 +61,13 @@ class ChatScreen extends PureComponent<Props> {
59
61
60
62
return (
61
63
< ActionSheetProvider >
62
- < View style = { [ contextStyles . screen , componentStyles . reverse ] } >
64
+ < View
65
+ style = { [
66
+ componentStyles . screen ,
67
+ { backgroundColor : this . context . backgroundColor } ,
68
+ componentStyles . reverse ,
69
+ ] }
70
+ >
63
71
< KeyboardAvoider style = { styles . flexed } behavior = "padding" >
64
72
< UnreadNotice narrow = { narrow } />
65
73
{ sayNoMessages ? (
0 commit comments