From c56d26731658777d6618ffbb22e80e1234064406 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Sat, 14 Aug 2021 10:51:08 +0200 Subject: [PATCH] Migrate TopUnreadMessagesBar to TypeScript --- ...dMessagesBar.js => TopUnreadMessagesBar.tsx} | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename src/components/views/rooms/{TopUnreadMessagesBar.js => TopUnreadMessagesBar.tsx} (84%) diff --git a/src/components/views/rooms/TopUnreadMessagesBar.js b/src/components/views/rooms/TopUnreadMessagesBar.tsx similarity index 84% rename from src/components/views/rooms/TopUnreadMessagesBar.js rename to src/components/views/rooms/TopUnreadMessagesBar.tsx index d2a3e3a303..01797299cf 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.js +++ b/src/components/views/rooms/TopUnreadMessagesBar.tsx @@ -1,7 +1,7 @@ /* Copyright 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd -Copyright 2019 New Vector Ltd +Copyright 2019-2021 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,19 +17,18 @@ limitations under the License. */ import React from 'react'; -import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; import AccessibleButton from '../elements/AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -@replaceableComponent("views.rooms.TopUnreadMessagesBar") -export default class TopUnreadMessagesBar extends React.Component { - static propTypes = { - onScrollUpClick: PropTypes.func, - onCloseClick: PropTypes.func, - }; +interface IProps { + onScrollUpClick?: (e: React.MouseEvent) => void; + onCloseClick?: (e: React.MouseEvent) => void; +} - render() { +@replaceableComponent("views.rooms.TopUnreadMessagesBar") +export default class TopUnreadMessagesBar extends React.PureComponent { + public render(): JSX.Element { return (