Browse Source

[RN] Replace chat modal with SlidingView

master
Bettenbuk Zoltan 6 years ago
parent
commit
13212a5980

+ 0
- 178
react/features/base/react/components/native/SideBar.js View File

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 View File

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 View File

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

+ 31
- 0
react/features/base/react/components/native/slidingviewstyles.js View File

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 View File

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { StyleSheet } from 'react-native';
4
-
5
 import { BoxModel, ColorPalette, createStyleSheet } from '../../../styles';
3
 import { BoxModel, ColorPalette, createStyleSheet } from '../../../styles';
6
 
4
 
7
 const AVATAR_OPACITY = 0.4;
5
 const AVATAR_OPACITY = 0.4;
9
 const SECONDARY_ACTION_BUTTON_SIZE = 30;
7
 const SECONDARY_ACTION_BUTTON_SIZE = 30;
10
 
8
 
11
 export const AVATAR_SIZE = 65;
9
 export const AVATAR_SIZE = 65;
12
-export const SIDEBAR_WIDTH = 250;
13
 export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
10
 export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
14
 
11
 
15
 /**
12
 /**
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
 export const TINTED_VIEW_DEFAULT = {
241
 export const TINTED_VIEW_DEFAULT = {
274
     backgroundColor: ColorPalette.appBackground,
242
     backgroundColor: ColorPalette.appBackground,
275
     opacity: 0.8
243
     opacity: 0.8
281
  */
249
  */
282
 export default createStyleSheet({
250
 export default createStyleSheet({
283
     ...PAGED_LIST_STYLES,
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 View File

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 View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
-import { SafeAreaView } from 'react-native';
4
+import { SafeAreaView, View } from 'react-native';
5
 import { GiftedChat } from 'react-native-gifted-chat';
5
 import { GiftedChat } from 'react-native-gifted-chat';
6
 
6
 
7
 import { translate } from '../../../base/i18n';
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
 import { connect } from '../../../base/redux';
15
 import { connect } from '../../../base/redux';
10
 
16
 
11
 import AbstractChat, {
17
 import AbstractChat, {
12
     _mapDispatchToProps,
18
     _mapDispatchToProps,
13
-    _mapStateToProps as _abstractMapStateToProps,
14
-    type Props as AbstractProps
19
+    _mapStateToProps,
20
+    type Props
15
 } from '../AbstractChat';
21
 } from '../AbstractChat';
16
 
22
 
17
 import ChatMessage from './ChatMessage';
23
 import ChatMessage from './ChatMessage';
18
 import styles from './styles';
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
  * Implements a React native component that renders the chat window (modal) of
27
  * Implements a React native component that renders the chat window (modal) of
31
  * the mobile client.
28
  * the mobile client.
55
         // of messages.
52
         // of messages.
56
         const messages
53
         const messages
57
             = this.props._messages.map(this._transformMessage).reverse();
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
         return (
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
     }
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
 export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));
138
 export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));

+ 3
- 34
react/features/chat/components/native/ChatMessage.js View File

8
 import { connect } from '../../../base/redux';
8
 import { connect } from '../../../base/redux';
9
 
9
 
10
 import AbstractChatMessage, {
10
 import AbstractChatMessage, {
11
-    _mapStateToProps as _abstractMapStateToProps,
12
-    type Props as AbstractProps
11
+    _mapStateToProps,
12
+    type Props
13
 } from '../AbstractChatMessage';
13
 } from '../AbstractChatMessage';
14
 import styles from './styles';
14
 import styles from './styles';
15
 
15
 
23
  */
23
  */
24
 const TIMESTAMP_FORMAT = 'H:mm';
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
  * Renders a single chat message.
27
  * Renders a single chat message.
36
  */
28
  */
54
         const textWrapperStyle = [
46
         const textWrapperStyle = [
55
             styles.textWrapper
47
             styles.textWrapper
56
         ];
48
         ];
57
-        const timeTextStyles = [
58
-            styles.timeText
59
-        ];
60
 
49
 
61
         if (localMessage) {
50
         if (localMessage) {
62
             // The wrapper needs to be aligned to the right.
51
             // The wrapper needs to be aligned to the right.
69
             textWrapperStyle.push(styles.systemTextWrapper);
58
             textWrapperStyle.push(styles.systemTextWrapper);
70
         }
59
         }
71
 
60
 
72
-        if (this.props._solidBackground) {
73
-            timeTextStyles.push(styles.solidBGTimeText);
74
-        }
75
-
76
         return (
61
         return (
77
             <View style = { styles.messageWrapper } >
62
             <View style = { styles.messageWrapper } >
78
                 {
63
                 {
92
                             { message.text }
77
                             { message.text }
93
                         </Text>
78
                         </Text>
94
                     </View>
79
                     </View>
95
-                    <Text style = { timeTextStyles }>
80
+                    <Text style = { styles.timeText }>
96
                         { timeStamp }
81
                         { timeStamp }
97
                     </Text>
82
                     </Text>
98
                 </View>
83
                 </View>
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
 export default translate(connect(_mapStateToProps)(ChatMessage));
121
 export default translate(connect(_mapStateToProps)(ChatMessage));

+ 17
- 28
react/features/chat/components/native/styles.js View File

1
 // @flow
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
  * The styles of the feature chat.
6
  * The styles of the feature chat.
13
  * need to extract the brand colors and sizes into a branding feature (planned
10
  * need to extract the brand colors and sizes into a branding feature (planned
14
  * for the future).
11
  * for the future).
15
  */
12
  */
16
-export default createStyleSheet({
13
+export default {
17
 
14
 
18
     /**
15
     /**
19
      * Wrapper View for the avatar.
16
      * Wrapper View for the avatar.
22
         marginRight: 8
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
      * Wrapper for the details together, such as name, message and time.
36
      * Wrapper for the details together, such as name, message and time.
27
      */
37
      */
58
         marginVertical: 4
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
      * Style modifier for the {@code detailsWrapper} for own messages.
72
      * Style modifier for the {@code detailsWrapper} for own messages.
73
      */
73
      */
84
         borderTopRightRadius: 0
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
      * Style modifier for system (error) messages.
88
      * Style modifier for system (error) messages.
100
      */
89
      */
118
      * Text node for the timestamp.
107
      * Text node for the timestamp.
119
      */
108
      */
120
     timeText: {
109
     timeText: {
121
-        color: ColorPalette.white,
110
+        color: 'rgb(164, 184, 209)',
122
         fontSize: 13
111
         fontSize: 13
123
     }
112
     }
124
-});
113
+};

+ 6
- 4
react/features/welcome/components/WelcomePageSideBar.native.js View File

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

+ 7
- 0
react/features/welcome/components/styles.js View File

171
         flexDirection: 'column'
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
      * The body of the side bar where the items are.
182
      * The body of the side bar where the items are.
176
      */
183
      */

Loading…
Cancel
Save