Parcourir la source

[RN] Replace chat modal with SlidingView

master
Bettenbuk Zoltan il y a 6 ans
Parent
révision
13212a5980

+ 0
- 178
react/features/base/react/components/native/SideBar.js Voir le fichier

@@ -1,178 +0,0 @@
1
-// @flow
2
-
3
-import React, { PureComponent, type Node } from 'react';
4
-import { Animated, TouchableWithoutFeedback, View } from 'react-native';
5
-
6
-import styles, { SIDEBAR_WIDTH } from './styles';
7
-
8
-/**
9
- * The type of the React {@code Component} props of {@link SideBar}.
10
- */
11
-type Props = {
12
-
13
-    /**
14
-     * The children of {@code SideBar}.
15
-     */
16
-    children: Node,
17
-
18
-    /**
19
-     * Callback to notify the containing {@code Component} that the sidebar is
20
-     * closing.
21
-     */
22
-    onHide: Function,
23
-
24
-    /**
25
-     * Whether the menu (of the {@code SideBar}?) is displayed/rendered/shown.
26
-     */
27
-    show: boolean
28
-};
29
-
30
-/**
31
- * The type of the React {@code Component} state of {@link SideBar}.
32
- */
33
-type State = {
34
-
35
-    /**
36
-     * Whether the side overlay should be displayed/rendered/shown.
37
-     */
38
-    showOverlay: boolean,
39
-
40
-    /**
41
-     * The native animation object.
42
-     */
43
-    sliderAnimation: Animated.Value
44
-};
45
-
46
-/**
47
- * A generic animated side bar to be used for left-side, hamburger-style menus.
48
- */
49
-export default class SideBar extends PureComponent<Props, State> {
50
-    /**
51
-     * Implements React's {@link Component#getDerivedStateFromProps()}.
52
-     *
53
-     * @inheritdoc
54
-     */
55
-    static getDerivedStateFromProps(props: Props, prevState: State) {
56
-        return {
57
-            showOverlay: props.show || prevState.showOverlay
58
-        };
59
-    }
60
-
61
-    /**
62
-     * Initializes a new {@code SideBar} instance.
63
-     *
64
-     * @inheritdoc
65
-     */
66
-    constructor(props: Props) {
67
-        super(props);
68
-
69
-        this.state = {
70
-            showOverlay: false,
71
-            sliderAnimation: new Animated.Value(0)
72
-        };
73
-
74
-        // Bind event handlers so they are only bound once per instance.
75
-        this._onHideMenu = this._onHideMenu.bind(this);
76
-    }
77
-
78
-    /**
79
-     * Implements React's {@link Component#componentDidMount()}.
80
-     *
81
-     * @inheritdoc
82
-     */
83
-    componentDidMount() {
84
-        this._setShow(this.props.show);
85
-    }
86
-
87
-    /**
88
-     * Implements React's {@link Component#componentDidUpdate()}.
89
-     *
90
-     * @inheritdoc
91
-     */
92
-    componentDidUpdate() {
93
-        this._setShow(this.props.show);
94
-    }
95
-
96
-    /**
97
-     * Implements React's {@link Component#render()}.
98
-     *
99
-     * @inheritdoc
100
-     */
101
-    render() {
102
-        return (
103
-            <View
104
-                pointerEvents = 'box-none'
105
-                style = { styles.sideMenuContainer } >
106
-                {
107
-                    this.state.showOverlay
108
-                        && <TouchableWithoutFeedback
109
-                            onPress = { this._onHideMenu } >
110
-                            <View style = { styles.sideMenuShadow } />
111
-                        </TouchableWithoutFeedback>
112
-                }
113
-                <Animated.View style = { this._getContentStyle() }>
114
-                    { this.props.children }
115
-                </Animated.View>
116
-            </View>
117
-        );
118
-    }
119
-
120
-    _getContentStyle: () => Array<Object>;
121
-
122
-    /**
123
-     * Assembles a style array for the sidebar content.
124
-     *
125
-     * @private
126
-     * @returns {Array<Object>}
127
-     */
128
-    _getContentStyle() {
129
-        return [
130
-            styles.sideMenuContent,
131
-            { transform: [ { translateX: this.state.sliderAnimation } ] }
132
-        ];
133
-    }
134
-
135
-    _onHideMenu: () => void;
136
-
137
-    /**
138
-     * Hides the side menu.
139
-     *
140
-     * @private
141
-     * @returns {void}
142
-     */
143
-    _onHideMenu() {
144
-        this._setShow(false);
145
-
146
-        const { onHide } = this.props;
147
-
148
-        onHide && onHide();
149
-    }
150
-
151
-    _setShow: (boolean) => void;
152
-
153
-    /**
154
-     * Shows/hides the side menu.
155
-     *
156
-     * @param {boolean} show - If the side menu is to be made visible,
157
-     * {@code true}; otherwise, {@code false}.
158
-     * @private
159
-     * @returns {void}
160
-     */
161
-    _setShow(show) {
162
-        Animated
163
-            .timing(
164
-                /* value */ this.state.sliderAnimation,
165
-                /* config */ {
166
-                    toValue: show ? SIDEBAR_WIDTH : 0,
167
-                    useNativeDriver: true
168
-                })
169
-            .start(({ finished }) => {
170
-                finished && !show && this.setState({ showOverlay: false });
171
-
172
-                // XXX Technically, the arrow function can further be simplified
173
-                // by removing the {} and returning the boolean expression
174
-                // above. Practically and unfortunately though, Flow freaks out
175
-                // and states that Animated.timing doesn't exist!?
176
-            });
177
-    }
178
-}

+ 265
- 0
react/features/base/react/components/native/SlidingView.js Voir le fichier

@@ -0,0 +1,265 @@
1
+// @flow
2
+
3
+import React, { PureComponent, type Node } from 'react';
4
+import {
5
+    Animated,
6
+    Dimensions,
7
+    TouchableWithoutFeedback,
8
+    View
9
+} from 'react-native';
10
+
11
+import { type StyleType } from '../../../styles';
12
+
13
+import styles from './slidingviewstyles';
14
+
15
+/**
16
+ * The type of the React {@code Component} props of {@link SlidingView}.
17
+ */
18
+type Props = {
19
+
20
+    /**
21
+     * The children of {@code SlidingView}.
22
+     */
23
+    children: Node,
24
+
25
+    /**
26
+     * Callback to notify the containing {@code Component} that the view is
27
+     * closing.
28
+     */
29
+    onHide: Function,
30
+
31
+    /**
32
+     * Position of the SlidingView: 'left', 'right', 'top', 'bottom'.
33
+     * later).
34
+     */
35
+    position: string,
36
+
37
+    /**
38
+     * Whether the {@code SlidingView} is to be displayed/rendered/shown or not.
39
+     */
40
+    show: boolean,
41
+
42
+    /**
43
+     * Style of the animated view.
44
+     */
45
+    style: StyleType
46
+};
47
+
48
+/**
49
+ * The type of the React {@code Component} state of {@link SlidingView}.
50
+ */
51
+type State = {
52
+
53
+    /**
54
+     * Whether the sliding overlay should be displayed/rendered/shown.
55
+     */
56
+    showOverlay: boolean,
57
+
58
+    /**
59
+     * The native animation object.
60
+     */
61
+    sliderAnimation: Animated.Value,
62
+
63
+    /**
64
+     * Offset to move the view out of the screen.
65
+     */
66
+    positionOffset: number
67
+};
68
+
69
+/**
70
+ * A generic animated slider view to be used for animated menus.
71
+ */
72
+export default class SlidingView extends PureComponent<Props, State> {
73
+    /**
74
+     * True if the component is mounted.
75
+     */
76
+    _mounted: boolean;
77
+
78
+    /**
79
+     * Implements React's {@link Component#getDerivedStateFromProps()}.
80
+     *
81
+     * @inheritdoc
82
+     */
83
+    static getDerivedStateFromProps(props: Props, prevState: State) {
84
+        return {
85
+            showOverlay: props.show || prevState.showOverlay
86
+        };
87
+    }
88
+
89
+    /**
90
+     * Initializes a new {@code SlidingView} instance.
91
+     *
92
+     * @inheritdoc
93
+     */
94
+    constructor(props: Props) {
95
+        super(props);
96
+
97
+        const { height, width } = Dimensions.get('window');
98
+        const { position } = props;
99
+
100
+        let positionOffset = height;
101
+
102
+        if (position === 'left' || position === 'right') {
103
+            positionOffset = width;
104
+        }
105
+
106
+        this.state = {
107
+            showOverlay: false,
108
+            sliderAnimation: new Animated.Value(0),
109
+            positionOffset
110
+        };
111
+
112
+        // Bind event handlers so they are only bound once per instance.
113
+        this._onHideMenu = this._onHideMenu.bind(this);
114
+    }
115
+
116
+    /**
117
+     * Implements React's {@link Component#componentDidMount()}.
118
+     *
119
+     * @inheritdoc
120
+     */
121
+    componentDidMount() {
122
+        this._mounted = true;
123
+        this._setShow(this.props.show);
124
+    }
125
+
126
+    /**
127
+     * Implements React's {@link Component#componentDidUpdate()}.
128
+     *
129
+     * @inheritdoc
130
+     */
131
+    componentDidUpdate() {
132
+        this._setShow(this.props.show);
133
+    }
134
+
135
+    /**
136
+     * Implements React's {@link Component#componentWillUnmount()}.
137
+     *
138
+     * @inheritdoc
139
+     */
140
+    componentWillUnmount() {
141
+        this._mounted = false;
142
+    }
143
+
144
+    /**
145
+     * Implements React's {@link Component#render()}.
146
+     *
147
+     * @inheritdoc
148
+     */
149
+    render() {
150
+        const { showOverlay } = this.state;
151
+
152
+        if (!showOverlay) {
153
+            return null;
154
+        }
155
+
156
+        return (
157
+            <View
158
+                pointerEvents = 'box-none'
159
+                style = { styles.sliderViewContainer } >
160
+                <TouchableWithoutFeedback
161
+                    onPress = { this._onHideMenu } >
162
+                    <View style = { styles.sliderViewShadow } />
163
+                </TouchableWithoutFeedback>
164
+                <Animated.View
165
+                    style = { this._getContentStyle() }>
166
+                    { this.props.children }
167
+                </Animated.View>
168
+            </View>
169
+        );
170
+    }
171
+
172
+    _getContentStyle: () => Array<Object>;
173
+
174
+    /**
175
+     * Assembles a style array for the SlideView content.
176
+     *
177
+     * @private
178
+     * @returns {Array<Object>}
179
+     */
180
+    _getContentStyle() {
181
+        const style = {
182
+            ...this.props.style,
183
+            ...styles.sliderViewContent
184
+        };
185
+        const { positionOffset } = this.state;
186
+
187
+        switch (this.props.position) {
188
+        case 'bottom':
189
+            Object.assign(style, {
190
+                bottom: -positionOffset,
191
+                left: 0,
192
+                right: 0,
193
+                top: positionOffset
194
+            }, {
195
+                transform: [ { translateY: this.state.sliderAnimation } ]
196
+            });
197
+            break;
198
+        case 'left':
199
+            Object.assign(style, {
200
+                bottom: 0,
201
+                left: -positionOffset,
202
+                right: positionOffset,
203
+                top: 0
204
+            }, {
205
+                transform: [ { translateX: this.state.sliderAnimation } ]
206
+            });
207
+            break;
208
+        }
209
+
210
+        return style;
211
+    }
212
+
213
+    _onHideMenu: () => void;
214
+
215
+    /**
216
+     * Hides the slider.
217
+     *
218
+     * @private
219
+     * @returns {void}
220
+     */
221
+    _onHideMenu() {
222
+        this._setShow(false);
223
+
224
+        const { onHide } = this.props;
225
+
226
+        onHide && onHide();
227
+    }
228
+
229
+    _setShow: (boolean) => void;
230
+
231
+    /**
232
+     * Shows/hides the slider menu.
233
+     *
234
+     * @param {boolean} show - If the slider view is to be made visible,
235
+     * {@code true}; otherwise, {@code false}.
236
+     * @private
237
+     * @returns {void}
238
+     */
239
+    _setShow(show) {
240
+        if (!this._mounted) {
241
+            return;
242
+        }
243
+
244
+        const { positionOffset } = this.state;
245
+        const { position } = this.props;
246
+        let toValue = positionOffset;
247
+
248
+        if (position === 'bottom' || position === 'right') {
249
+            toValue = -positionOffset;
250
+        }
251
+
252
+        Animated
253
+            .timing(
254
+                /* value */ this.state.sliderAnimation,
255
+                /* config */ {
256
+                    duration: 200,
257
+                    toValue: show ? toValue : 0,
258
+                    useNativeDriver: true
259
+                })
260
+            .start(({ finished }) => {
261
+                finished && this._mounted && !show
262
+                    && this.setState({ showOverlay: false });
263
+            });
264
+    }
265
+}

+ 1
- 1
react/features/base/react/components/native/index.js Voir le fichier

@@ -20,7 +20,7 @@ export { default as NavigateSectionListSectionHeader }
20 20
 export { default as PagedList } from './PagedList';
21 21
 export { default as Pressable } from './Pressable';
22 22
 export { default as SectionList } from './SectionList';
23
-export { default as SideBar } from './SideBar';
23
+export { default as SlidingView } from './SlidingView';
24 24
 export { default as Switch } from './Switch';
25 25
 export { default as Text } from './Text';
26 26
 export { default as TintedView } from './TintedView';

+ 31
- 0
react/features/base/react/components/native/slidingviewstyles.js Voir le fichier

@@ -0,0 +1,31 @@
1
+// @flow
2
+
3
+import { StyleSheet } from 'react-native';
4
+
5
+import { OVERLAY_Z_INDEX } from '../../constants';
6
+
7
+export default {
8
+    /**
9
+     * The topmost container of the side bar.
10
+     */
11
+    sliderViewContainer: {
12
+        ...StyleSheet.absoluteFillObject,
13
+        zIndex: OVERLAY_Z_INDEX
14
+    },
15
+
16
+    /**
17
+     * The container of the actual content of the side menu.
18
+     */
19
+    sliderViewContent: {
20
+        position: 'absolute'
21
+    },
22
+
23
+    /**
24
+     * The opaque area that covers the rest of the screen, when the side bar is
25
+     * open.
26
+     */
27
+    sliderViewShadow: {
28
+        ...StyleSheet.absoluteFillObject,
29
+        backgroundColor: 'rgba(0, 0, 0, 0.5)'
30
+    }
31
+};

+ 1
- 34
react/features/base/react/components/native/styles.js Voir le fichier

@@ -1,7 +1,5 @@
1 1
 // @flow
2 2
 
3
-import { StyleSheet } from 'react-native';
4
-
5 3
 import { BoxModel, ColorPalette, createStyleSheet } from '../../../styles';
6 4
 
7 5
 const AVATAR_OPACITY = 0.4;
@@ -9,7 +7,6 @@ const OVERLAY_FONT_COLOR = 'rgba(255, 255, 255, 0.6)';
9 7
 const SECONDARY_ACTION_BUTTON_SIZE = 30;
10 8
 
11 9
 export const AVATAR_SIZE = 65;
12
-export const SIDEBAR_WIDTH = 250;
13 10
 export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
14 11
 
15 12
 /**
@@ -241,35 +238,6 @@ const SECTION_LIST_STYLES = {
241 238
     }
242 239
 };
243 240
 
244
-const SIDEBAR_STYLES = {
245
-    /**
246
-     * The topmost container of the side bar.
247
-     */
248
-    sideMenuContainer: {
249
-        ...StyleSheet.absoluteFillObject
250
-    },
251
-
252
-    /**
253
-     * The container of the actual content of the side menu.
254
-     */
255
-    sideMenuContent: {
256
-        bottom: 0,
257
-        left: -SIDEBAR_WIDTH,
258
-        position: 'absolute',
259
-        top: 0,
260
-        width: SIDEBAR_WIDTH
261
-    },
262
-
263
-    /**
264
-     * The opaque area that covers the rest of the screen, when the side bar is
265
-     * open.
266
-     */
267
-    sideMenuShadow: {
268
-        ...StyleSheet.absoluteFillObject,
269
-        backgroundColor: 'rgba(0, 0, 0, 0.5)'
270
-    }
271
-};
272
-
273 241
 export const TINTED_VIEW_DEFAULT = {
274 242
     backgroundColor: ColorPalette.appBackground,
275 243
     opacity: 0.8
@@ -281,6 +249,5 @@ export const TINTED_VIEW_DEFAULT = {
281 249
  */
282 250
 export default createStyleSheet({
283 251
     ...PAGED_LIST_STYLES,
284
-    ...SECTION_LIST_STYLES,
285
-    ...SIDEBAR_STYLES
252
+    ...SECTION_LIST_STYLES
286 253
 });

+ 7
- 0
react/features/base/react/constants.js Voir le fichier

@@ -0,0 +1,7 @@
1
+// @flow
2
+
3
+/**
4
+ * Z-index for components that are to be rendered like an overlay, to be over
5
+ * everything, such as modal-type of components, or dialogs.
6
+ */
7
+export const OVERLAY_Z_INDEX = 1000;

+ 26
- 54
react/features/chat/components/native/Chat.js Voir le fichier

@@ -1,31 +1,28 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
-import { SafeAreaView } from 'react-native';
4
+import { SafeAreaView, View } from 'react-native';
5 5
 import { GiftedChat } from 'react-native-gifted-chat';
6 6
 
7 7
 import { translate } from '../../../base/i18n';
8
-import { BackButton, Header, HeaderLabel, Modal } from '../../../base/react';
8
+
9
+import {
10
+    BackButton,
11
+    Header,
12
+    HeaderLabel,
13
+    SlidingView
14
+} from '../../../base/react';
9 15
 import { connect } from '../../../base/redux';
10 16
 
11 17
 import AbstractChat, {
12 18
     _mapDispatchToProps,
13
-    _mapStateToProps as _abstractMapStateToProps,
14
-    type Props as AbstractProps
19
+    _mapStateToProps,
20
+    type Props
15 21
 } from '../AbstractChat';
16 22
 
17 23
 import ChatMessage from './ChatMessage';
18 24
 import styles from './styles';
19 25
 
20
-type Props = AbstractProps & {
21
-
22
-    /**
23
-     * True if the chat window should have a solid BG render.
24
-     */
25
-    _solidBackground: boolean
26
-}
27
-
28
-
29 26
 /**
30 27
  * Implements a React native component that renders the chat window (modal) of
31 28
  * the mobile client.
@@ -55,32 +52,24 @@ class Chat extends AbstractChat<Props> {
55 52
         // of messages.
56 53
         const messages
57 54
             = this.props._messages.map(this._transformMessage).reverse();
58
-        const modalStyle = [
59
-            styles.modalBackdrop
60
-        ];
61
-
62
-        if (this.props._solidBackground) {
63
-            // We only use a transparent background, when we are in a video
64
-            // meeting to give a user a glympse of what's happening. Otherwise
65
-            // we use a non-transparent background.
66
-            modalStyle.push(styles.solidModalBackdrop);
67
-        }
68 55
 
69 56
         return (
70
-            <Modal
71
-                onRequestClose = { this.props._onToggleChat }
72
-                visible = { this.props._isOpen }>
73
-                <Header>
74
-                    <BackButton onPress = { this.props._onToggleChat } />
75
-                    <HeaderLabel labelKey = 'chat.title' />
76
-                </Header>
77
-                <SafeAreaView style = { modalStyle }>
78
-                    <GiftedChat
79
-                        messages = { messages }
80
-                        onSend = { this._onSend }
81
-                        renderMessage = { this._renderMessage } />
82
-                </SafeAreaView>
83
-            </Modal>
57
+            <SlidingView
58
+                position = 'bottom'
59
+                show = { this.props._isOpen } >
60
+                <View style = { styles.chatContainer }>
61
+                    <Header>
62
+                        <BackButton onPress = { this.props._onToggleChat } />
63
+                        <HeaderLabel labelKey = 'chat.title' />
64
+                    </Header>
65
+                    <SafeAreaView style = { styles.backdrop }>
66
+                        <GiftedChat
67
+                            messages = { messages }
68
+                            onSend = { this._onSend }
69
+                            renderMessage = { this._renderMessage } />
70
+                    </SafeAreaView>
71
+                </View>
72
+            </SlidingView>
84 73
         );
85 74
     }
86 75
 
@@ -146,21 +135,4 @@ class Chat extends AbstractChat<Props> {
146 135
     }
147 136
 }
148 137
 
149
-/**
150
- * Maps part of the Redux state to the props of this component.
151
- *
152
- * @param {Object} state - The Redux state.
153
- * @returns {{
154
- *     _solidBackground: boolean
155
- * }}
156
- */
157
-function _mapStateToProps(state) {
158
-    const abstractReduxProps = _abstractMapStateToProps(state);
159
-
160
-    return {
161
-        ...abstractReduxProps,
162
-        _solidBackground: state['features/base/conference'].audioOnly
163
-    };
164
-}
165
-
166 138
 export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));

+ 3
- 34
react/features/chat/components/native/ChatMessage.js Voir le fichier

@@ -8,8 +8,8 @@ import { Avatar } from '../../../base/participants';
8 8
 import { connect } from '../../../base/redux';
9 9
 
10 10
 import AbstractChatMessage, {
11
-    _mapStateToProps as _abstractMapStateToProps,
12
-    type Props as AbstractProps
11
+    _mapStateToProps,
12
+    type Props
13 13
 } from '../AbstractChatMessage';
14 14
 import styles from './styles';
15 15
 
@@ -23,14 +23,6 @@ const AVATAR_SIZE = 32;
23 23
  */
24 24
 const TIMESTAMP_FORMAT = 'H:mm';
25 25
 
26
-type Props = AbstractProps & {
27
-
28
-    /**
29
-     * True if the chat window has a solid BG so then we have to adopt in style.
30
-     */
31
-    _solidBackground: boolean
32
-}
33
-
34 26
 /**
35 27
  * Renders a single chat message.
36 28
  */
@@ -54,9 +46,6 @@ class ChatMessage extends AbstractChatMessage<Props> {
54 46
         const textWrapperStyle = [
55 47
             styles.textWrapper
56 48
         ];
57
-        const timeTextStyles = [
58
-            styles.timeText
59
-        ];
60 49
 
61 50
         if (localMessage) {
62 51
             // The wrapper needs to be aligned to the right.
@@ -69,10 +58,6 @@ class ChatMessage extends AbstractChatMessage<Props> {
69 58
             textWrapperStyle.push(styles.systemTextWrapper);
70 59
         }
71 60
 
72
-        if (this.props._solidBackground) {
73
-            timeTextStyles.push(styles.solidBGTimeText);
74
-        }
75
-
76 61
         return (
77 62
             <View style = { styles.messageWrapper } >
78 63
                 {
@@ -92,7 +77,7 @@ class ChatMessage extends AbstractChatMessage<Props> {
92 77
                             { message.text }
93 78
                         </Text>
94 79
                     </View>
95
-                    <Text style = { timeTextStyles }>
80
+                    <Text style = { styles.timeText }>
96 81
                         { timeStamp }
97 82
                     </Text>
98 83
                 </View>
@@ -133,20 +118,4 @@ class ChatMessage extends AbstractChatMessage<Props> {
133 118
     }
134 119
 }
135 120
 
136
-/**
137
- * Maps part of the Redux state to the props of this component.
138
- *
139
- * @param {Object} state - The Redux state.
140
- * @param {Props} ownProps - The own props of the component.
141
- * @returns {{
142
- *     _solidBackground: boolean
143
- * }}
144
- */
145
-function _mapStateToProps(state, ownProps) {
146
-    return {
147
-        ..._abstractMapStateToProps(state, ownProps),
148
-        _solidBackground: state['features/base/conference'].audioOnly
149
-    };
150
-}
151
-
152 121
 export default translate(connect(_mapStateToProps)(ChatMessage));

+ 17
- 28
react/features/chat/components/native/styles.js Voir le fichier

@@ -1,9 +1,6 @@
1 1
 // @flow
2 2
 
3
-import {
4
-    ColorPalette,
5
-    createStyleSheet
6
-} from '../../../base/styles';
3
+import { ColorPalette } from '../../../base/styles';
7 4
 
8 5
 /**
9 6
  * The styles of the feature chat.
@@ -13,7 +10,7 @@ import {
13 10
  * need to extract the brand colors and sizes into a branding feature (planned
14 11
  * for the future).
15 12
  */
16
-export default createStyleSheet({
13
+export default {
17 14
 
18 15
     /**
19 16
      * Wrapper View for the avatar.
@@ -22,6 +19,19 @@ export default createStyleSheet({
22 19
         marginRight: 8
23 20
     },
24 21
 
22
+    /**
23
+     * Background of the chat screen.
24
+     */
25
+    backdrop: {
26
+        backgroundColor: ColorPalette.white,
27
+        flex: 1
28
+    },
29
+
30
+    chatContainer: {
31
+        flex: 1,
32
+        flexDirection: 'column'
33
+    },
34
+
25 35
     /**
26 36
      * Wrapper for the details together, such as name, message and time.
27 37
      */
@@ -58,16 +68,6 @@ export default createStyleSheet({
58 68
         marginVertical: 4
59 69
     },
60 70
 
61
-    /**
62
-     * Background of the chat screen. Currently it's set to a transparent value
63
-     * as the idea is that the participant would still want to see at least a
64
-     * part of the video when he/she is in the chat window.
65
-     */
66
-    modalBackdrop: {
67
-        backgroundColor: 'rgba(127, 127, 127, 0.8)',
68
-        flex: 1
69
-    },
70
-
71 71
     /**
72 72
      * Style modifier for the {@code detailsWrapper} for own messages.
73 73
      */
@@ -84,17 +84,6 @@ export default createStyleSheet({
84 84
         borderTopRightRadius: 0
85 85
     },
86 86
 
87
-    solidBGTimeText: {
88
-        color: 'rgb(164, 184, 209)'
89
-    },
90
-
91
-    /**
92
-     * Style modifier for the chat window when we're in audio only mode.
93
-     */
94
-    solidModalBackdrop: {
95
-        backgroundColor: ColorPalette.white
96
-    },
97
-
98 87
     /**
99 88
      * Style modifier for system (error) messages.
100 89
      */
@@ -118,7 +107,7 @@ export default createStyleSheet({
118 107
      * Text node for the timestamp.
119 108
      */
120 109
     timeText: {
121
-        color: ColorPalette.white,
110
+        color: 'rgb(164, 184, 209)',
122 111
         fontSize: 13
123 112
     }
124
-});
113
+};

+ 6
- 4
react/features/welcome/components/WelcomePageSideBar.native.js Voir le fichier

@@ -11,7 +11,7 @@ import {
11 11
 } from '../../base/participants';
12 12
 import {
13 13
     Header,
14
-    SideBar
14
+    SlidingView
15 15
 } from '../../base/react';
16 16
 import { connect } from '../../base/redux';
17 17
 import { setSettingsViewVisible } from '../../settings';
@@ -83,9 +83,11 @@ class WelcomePageSideBar extends Component<Props> {
83 83
      */
84 84
     render() {
85 85
         return (
86
-            <SideBar
86
+            <SlidingView
87 87
                 onHide = { this._onHideSideBar }
88
-                show = { this.props._visible }>
88
+                position = 'left'
89
+                show = { this.props._visible }
90
+                style = { styles.sideBar } >
89 91
                 <Header style = { styles.sideBarHeader }>
90 92
                     <Avatar
91 93
                         size = { SIDEBAR_AVATAR_SIZE }
@@ -116,7 +118,7 @@ class WelcomePageSideBar extends Component<Props> {
116 118
                             url = { SEND_FEEDBACK_URL } />
117 119
                     </ScrollView>
118 120
                 </SafeAreaView>
119
-            </SideBar>
121
+            </SlidingView>
120 122
         );
121 123
     }
122 124
 

+ 7
- 0
react/features/welcome/components/styles.js Voir le fichier

@@ -171,6 +171,13 @@ export default createStyleSheet({
171 171
         flexDirection: 'column'
172 172
     },
173 173
 
174
+    /**
175
+     * Container of the side bar.
176
+     */
177
+    sideBar: {
178
+        width: 250
179
+    },
180
+
174 181
     /**
175 182
      * The body of the side bar where the items are.
176 183
      */

Chargement…
Annuler
Enregistrer