From 3a46513d4bde3cb93cff89a983d7a97f067ace8a Mon Sep 17 00:00:00 2001 From: Bettenbuk Zoltan Date: Wed, 6 Nov 2019 17:44:03 +0100 Subject: [PATCH] ref: remove unused code --- .../toolbox/components/native/Toolbox.js | 46 +------------------ 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/react/features/toolbox/components/native/Toolbox.js b/react/features/toolbox/components/native/Toolbox.js index 7e0db4944..c3ceb9b7c 100644 --- a/react/features/toolbox/components/native/Toolbox.js +++ b/react/features/toolbox/components/native/Toolbox.js @@ -1,6 +1,6 @@ // @flow -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import { View } from 'react-native'; import { ColorSchemeRegistry } from '../../../base/color-scheme'; @@ -46,37 +46,10 @@ type Props = { dispatch: Function }; -/** - * The type of {@link Toolbox}'s React {@code Component} state. - */ -type State = { - - /** - * The detected width for this component. - */ - width: number -}; - /** * Implements the conference toolbox on React Native. */ -class Toolbox extends Component { - state = { - width: 0 - }; - - /** - * Initializes a new {@code Toolbox} instance. - * - * @inheritdoc - */ - constructor(props: Props) { - super(props); - - // Bind event handlers so they are only bound once per instance. - this._onLayout = this._onLayout.bind(this); - } - +class Toolbox extends PureComponent { /** * Implements React's {@link Component#render()}. * @@ -86,7 +59,6 @@ class Toolbox extends Component { render() { return ( { this._renderToolbar() } @@ -125,20 +97,6 @@ class Toolbox extends Component { }; } - _onLayout: (Object) => void; - - /** - * Handles the "on layout" View's event and stores the width as state. - * - * @param {Object} event - The "on layout" event object/structure passed - * by react-native. - * @private - * @returns {void} - */ - _onLayout({ nativeEvent: { layout: { width } } }) { - this.setState({ width }); - } - /** * Renders the toolbar. In order to avoid a weird visual effect in which the * toolbar is (visually) rendered and then visibly changes its size, it is