From 3b2e29c85bde2e7f8bb223377c96b3927b5caa37 Mon Sep 17 00:00:00 2001 From: Junyong Liu Date: Mon, 2 Nov 2020 12:11:13 -0500 Subject: [PATCH] MM-20404 Migrate 'components/announcement_bar/version_bar' module and associated tests to TypeScript --- components/announcement_bar/version_bar/index.ts | 4 ++-- .../announcement_bar/version_bar/version_bar.tsx | 14 +++++++------- utils/server_version.tsx | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/announcement_bar/version_bar/index.ts b/components/announcement_bar/version_bar/index.ts index c7c7b162de56..3b034416b421 100644 --- a/components/announcement_bar/version_bar/index.ts +++ b/components/announcement_bar/version_bar/index.ts @@ -2,10 +2,10 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; - +import {GlobalState} from 'mattermost-redux/types/store'; import VersionBar from './version_bar'; -function mapStateToProps(state:any) { +function mapStateToProps(state:GlobalState) { return { serverVersion: state.entities.general.serverVersion, }; diff --git a/components/announcement_bar/version_bar/version_bar.tsx b/components/announcement_bar/version_bar/version_bar.tsx index 0090463fa1fe..88b79b79483d 100644 --- a/components/announcement_bar/version_bar/version_bar.tsx +++ b/components/announcement_bar/version_bar/version_bar.tsx @@ -10,16 +10,16 @@ import {AnnouncementBarTypes} from 'utils/constants'; import AnnouncementBar from '../default_announcement_bar'; -interface IMyComponentProps { - serverVersion?: string, +interface Props { + serverVersion: string, } -interface IMyComponentState { - serverVersionOnAppLoad?: string, +interface State { + serverVersionOnAppLoad: string, } -export default class VersionBar extends React.PureComponent { - constructor(props:IMyComponentProps) { +export default class VersionBar extends React.PureComponent { + constructor(props:Props) { super(props); this.state = { @@ -27,7 +27,7 @@ export default class VersionBar extends React.PureComponent