From 0d6e7759d0617b5a04e09a43726621397e77a8c2 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Tue, 7 Jul 2020 15:11:08 +0100 Subject: [PATCH] Fix review details - spelling mistake - unwatch watched setting - lint (indentation) - use more performant component --- res/css/_components.scss | 2 +- .../{_PulsedAatar.scss => _PulsedAvatar.scss} | 0 res/css/views/voip/_CallView2.scss | 2 ++ src/components/views/avatars/PulsedAvatar.tsx | 2 +- src/components/views/voip/CallContainer.tsx | 2 +- src/components/views/voip/CallPreview2.tsx | 15 +++++++++------ src/components/views/voip/CallView2.tsx | 3 +++ src/components/views/voip/IncomingCallBox2.tsx | 3 +++ 8 files changed, 20 insertions(+), 9 deletions(-) rename res/css/views/avatars/{_PulsedAatar.scss => _PulsedAvatar.scss} (100%) diff --git a/res/css/_components.scss b/res/css/_components.scss index 8f5fbf341f..85e08110ea 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -51,7 +51,7 @@ @import "./views/avatars/_BaseAvatar.scss"; @import "./views/avatars/_DecoratedRoomAvatar.scss"; @import "./views/avatars/_MemberStatusMessageAvatar.scss"; -@import "./views/avatars/_PulsedAatar.scss"; +@import "./views/avatars/_PulsedAvatar.scss"; @import "./views/context_menus/_MessageContextMenu.scss"; @import "./views/context_menus/_RoomTileContextMenu.scss"; @import "./views/context_menus/_StatusMessageContextMenu.scss"; diff --git a/res/css/views/avatars/_PulsedAatar.scss b/res/css/views/avatars/_PulsedAvatar.scss similarity index 100% rename from res/css/views/avatars/_PulsedAatar.scss rename to res/css/views/avatars/_PulsedAvatar.scss diff --git a/res/css/views/voip/_CallView2.scss b/res/css/views/voip/_CallView2.scss index 98d2052261..3b66e7a175 100644 --- a/res/css/views/voip/_CallView2.scss +++ b/res/css/views/voip/_CallView2.scss @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231 + .mx_CallView2_voice { background-color: $accent-color; color: $accent-fg-color; diff --git a/src/components/views/avatars/PulsedAvatar.tsx b/src/components/views/avatars/PulsedAvatar.tsx index 416937c685..578afeb9a1 100644 --- a/src/components/views/avatars/PulsedAvatar.tsx +++ b/src/components/views/avatars/PulsedAvatar.tsx @@ -21,7 +21,7 @@ interface IProps { const PulsedAvatar: React.FC = (props) => { return
- {props.children} + {props.children}
} diff --git a/src/components/views/voip/CallContainer.tsx b/src/components/views/voip/CallContainer.tsx index c5274d3844..684cc0acb9 100644 --- a/src/components/views/voip/CallContainer.tsx +++ b/src/components/views/voip/CallContainer.tsx @@ -27,7 +27,7 @@ interface IState { } -export default class CallContainer extends React.Component { +export default class CallContainer extends React.PureComponent { public render() { return
diff --git a/src/components/views/voip/CallPreview2.tsx b/src/components/views/voip/CallPreview2.tsx index bab59ff068..ec4956fb9a 100644 --- a/src/components/views/voip/CallPreview2.tsx +++ b/src/components/views/voip/CallPreview2.tsx @@ -15,8 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ +// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231 + import React from 'react'; -import classNames from 'classnames'; import CallView from "./CallView2"; import RoomViewStore from '../../../stores/RoomViewStore'; @@ -27,10 +28,10 @@ import PersistentApp from "../elements/PersistentApp"; import SettingsStore from "../../../settings/SettingsStore"; interface IProps { - // A Conference Handler implementation - // Must have a function signature: - // getConferenceCallForRoom(roomId: string): MatrixCall - ConferenceHandler: any; + // A Conference Handler implementation + // Must have a function signature: + // getConferenceCallForRoom(roomId: string): MatrixCall + ConferenceHandler: any; } interface IState { @@ -42,6 +43,7 @@ interface IState { export default class CallPreview extends React.Component { private roomStoreToken: any; private dispatcherRef: string; + private settingsWatcherRef: string; constructor(props: IProps) { super(props); @@ -52,7 +54,7 @@ export default class CallPreview extends React.Component { newRoomListActive: SettingsStore.getValue("feature_new_room_list"), }; - SettingsStore.watchSetting("feature_new_room_list", null, (name, roomId, level, valAtLevel, newVal) => this.setState({ + this.settingsWatcherRef = SettingsStore.watchSetting("feature_new_room_list", null, (name, roomId, level, valAtLevel, newVal) => this.setState({ newRoomListActive: newVal, })); } @@ -67,6 +69,7 @@ export default class CallPreview extends React.Component { this.roomStoreToken.remove(); } dis.unregister(this.dispatcherRef); + SettingsStore.unwatchSetting(this.settingsWatcherRef) } private onRoomViewStoreUpdate = (payload) => { diff --git a/src/components/views/voip/CallView2.tsx b/src/components/views/voip/CallView2.tsx index cc51a05a6f..3019436e86 100644 --- a/src/components/views/voip/CallView2.tsx +++ b/src/components/views/voip/CallView2.tsx @@ -14,6 +14,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231 + import React, {createRef} from 'react'; import Room from 'matrix-js-sdk/src/models/room'; import dis from '../../../dispatcher/dispatcher'; diff --git a/src/components/views/voip/IncomingCallBox2.tsx b/src/components/views/voip/IncomingCallBox2.tsx index adc4261430..cd90581b70 100644 --- a/src/components/views/voip/IncomingCallBox2.tsx +++ b/src/components/views/voip/IncomingCallBox2.tsx @@ -15,6 +15,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231 + import React from 'react'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher';