浏览代码

ref: remove unused code

j8
Bettenbuk Zoltan 5 年前
父节点
当前提交
3a46513d4b
共有 1 个文件被更改,包括 2 次插入44 次删除
  1. 2
    44
      react/features/toolbox/components/native/Toolbox.js

+ 2
- 44
react/features/toolbox/components/native/Toolbox.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React, { Component } from 'react';
3
+import React, { PureComponent } from 'react';
4
 import { View } from 'react-native';
4
 import { View } from 'react-native';
5
 
5
 
6
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
6
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
46
     dispatch: Function
46
     dispatch: Function
47
 };
47
 };
48
 
48
 
49
-/**
50
- * The type of {@link Toolbox}'s React {@code Component} state.
51
- */
52
-type State = {
53
-
54
-    /**
55
-     * The detected width for this component.
56
-     */
57
-    width: number
58
-};
59
-
60
 /**
49
 /**
61
  * Implements the conference toolbox on React Native.
50
  * Implements the conference toolbox on React Native.
62
  */
51
  */
63
-class Toolbox extends Component<Props, State> {
64
-    state = {
65
-        width: 0
66
-    };
67
-
68
-    /**
69
-     *  Initializes a new {@code Toolbox} instance.
70
-     *
71
-     * @inheritdoc
72
-     */
73
-    constructor(props: Props) {
74
-        super(props);
75
-
76
-        // Bind event handlers so they are only bound once per instance.
77
-        this._onLayout = this._onLayout.bind(this);
78
-    }
79
-
52
+class Toolbox extends PureComponent<Props> {
80
     /**
53
     /**
81
      * Implements React's {@link Component#render()}.
54
      * Implements React's {@link Component#render()}.
82
      *
55
      *
86
     render() {
59
     render() {
87
         return (
60
         return (
88
             <Container
61
             <Container
89
-                onLayout = { this._onLayout }
90
                 style = { styles.toolbox }
62
                 style = { styles.toolbox }
91
                 visible = { this.props._visible }>
63
                 visible = { this.props._visible }>
92
                 { this._renderToolbar() }
64
                 { this._renderToolbar() }
125
         };
97
         };
126
     }
98
     }
127
 
99
 
128
-    _onLayout: (Object) => void;
129
-
130
-    /**
131
-     * Handles the "on layout" View's event and stores the width as state.
132
-     *
133
-     * @param {Object} event - The "on layout" event object/structure passed
134
-     * by react-native.
135
-     * @private
136
-     * @returns {void}
137
-     */
138
-    _onLayout({ nativeEvent: { layout: { width } } }) {
139
-        this.setState({ width });
140
-    }
141
-
142
     /**
100
     /**
143
      * Renders the toolbar. In order to avoid a weird visual effect in which the
101
      * Renders the toolbar. In order to avoid a weird visual effect in which the
144
      * toolbar is (visually) rendered and then visibly changes its size, it is
102
      * toolbar is (visually) rendered and then visibly changes its size, it is

正在加载...
取消
保存