Fix review details

- spelling mistake
- unwatch watched setting
- lint (indentation)
- use more performant component
This commit is contained in:
Jorik Schellekens 2020-07-07 15:11:08 +01:00
parent 527fe24cd6
commit 0d6e7759d0
8 changed files with 20 additions and 9 deletions

View File

@ -51,7 +51,7 @@
@import "./views/avatars/_BaseAvatar.scss"; @import "./views/avatars/_BaseAvatar.scss";
@import "./views/avatars/_DecoratedRoomAvatar.scss"; @import "./views/avatars/_DecoratedRoomAvatar.scss";
@import "./views/avatars/_MemberStatusMessageAvatar.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/_MessageContextMenu.scss";
@import "./views/context_menus/_RoomTileContextMenu.scss"; @import "./views/context_menus/_RoomTileContextMenu.scss";
@import "./views/context_menus/_StatusMessageContextMenu.scss"; @import "./views/context_menus/_StatusMessageContextMenu.scss";

View File

@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231
.mx_CallView2_voice { .mx_CallView2_voice {
background-color: $accent-color; background-color: $accent-color;
color: $accent-fg-color; color: $accent-fg-color;

View File

@ -21,7 +21,7 @@ interface IProps {
const PulsedAvatar: React.FC<IProps> = (props) => { const PulsedAvatar: React.FC<IProps> = (props) => {
return <div className="mx_PulsedAvatar"> return <div className="mx_PulsedAvatar">
{props.children} {props.children}
</div> </div>
} }

View File

@ -27,7 +27,7 @@ interface IState {
} }
export default class CallContainer extends React.Component<IProps, IState> { export default class CallContainer extends React.PureComponent<IProps, IState> {
public render() { public render() {
return <div className="mx_CallContainer"> return <div className="mx_CallContainer">
<IncomingCallBox2 /> <IncomingCallBox2 />

View File

@ -15,8 +15,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231
import React from 'react'; import React from 'react';
import classNames from 'classnames';
import CallView from "./CallView2"; import CallView from "./CallView2";
import RoomViewStore from '../../../stores/RoomViewStore'; import RoomViewStore from '../../../stores/RoomViewStore';
@ -27,10 +28,10 @@ import PersistentApp from "../elements/PersistentApp";
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
interface IProps { interface IProps {
// A Conference Handler implementation // A Conference Handler implementation
// Must have a function signature: // Must have a function signature:
// getConferenceCallForRoom(roomId: string): MatrixCall // getConferenceCallForRoom(roomId: string): MatrixCall
ConferenceHandler: any; ConferenceHandler: any;
} }
interface IState { interface IState {
@ -42,6 +43,7 @@ interface IState {
export default class CallPreview extends React.Component<IProps, IState> { export default class CallPreview extends React.Component<IProps, IState> {
private roomStoreToken: any; private roomStoreToken: any;
private dispatcherRef: string; private dispatcherRef: string;
private settingsWatcherRef: string;
constructor(props: IProps) { constructor(props: IProps) {
super(props); super(props);
@ -52,7 +54,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
newRoomListActive: SettingsStore.getValue("feature_new_room_list"), 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, newRoomListActive: newVal,
})); }));
} }
@ -67,6 +69,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
this.roomStoreToken.remove(); this.roomStoreToken.remove();
} }
dis.unregister(this.dispatcherRef); dis.unregister(this.dispatcherRef);
SettingsStore.unwatchSetting(this.settingsWatcherRef)
} }
private onRoomViewStoreUpdate = (payload) => { private onRoomViewStoreUpdate = (payload) => {

View File

@ -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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231
import React, {createRef} from 'react'; import React, {createRef} from 'react';
import Room from 'matrix-js-sdk/src/models/room'; import Room from 'matrix-js-sdk/src/models/room';
import dis from '../../../dispatcher/dispatcher'; import dis from '../../../dispatcher/dispatcher';

View File

@ -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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231
import React from 'react'; import React from 'react';
import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {MatrixClientPeg} from '../../../MatrixClientPeg';
import dis from '../../../dispatcher/dispatcher'; import dis from '../../../dispatcher/dispatcher';