From ae9618367eef5a4c6a429f101ee5f1b424c50d1d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Mar 2021 13:06:53 -0700 Subject: [PATCH] Convert UploadBar to TypeScript --- .../{UploadBar.js => UploadBar.tsx} | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) rename src/components/structures/{UploadBar.js => UploadBar.tsx} (90%) diff --git a/src/components/structures/UploadBar.js b/src/components/structures/UploadBar.tsx similarity index 90% rename from src/components/structures/UploadBar.js rename to src/components/structures/UploadBar.tsx index 16cc4cb987..27d6746698 100644 --- a/src/components/structures/UploadBar.js +++ b/src/components/structures/UploadBar.tsx @@ -1,6 +1,5 @@ /* -Copyright 2015, 2016 OpenMarket Ltd -Copyright 2019 The Matrix.org Foundation C.I.C. +Copyright 2015, 2016, 2019, 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,16 +15,22 @@ limitations under the License. */ import React from 'react'; -import PropTypes from 'prop-types'; import ContentMessages from '../../ContentMessages'; import dis from "../../dispatcher/dispatcher"; import filesize from "filesize"; import { _t } from '../../languageHandler'; +import {Room} from "matrix-js-sdk/src/models/room"; -export default class UploadBar extends React.Component { - static propTypes = { - room: PropTypes.object, - }; +interface IProps { + room: Room; +} + +interface IState { +} + +export default class UploadBar extends React.Component { + private dispatcherRef: string; + private mounted: boolean; componentDidMount() { this.dispatcherRef = dis.register(this.onAction); @@ -37,7 +42,7 @@ export default class UploadBar extends React.Component { dis.unregister(this.dispatcherRef); } - onAction = payload => { + private onAction = (payload) => { switch (payload.action) { case 'upload_progress': case 'upload_finished':