mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-12 13:16:10 +03:00
Migrate SimpleRoomHeader to TypeScript
This commit is contained in:
parent
7e4c88f6ba
commit
eb120901ae
1 changed files with 9 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2016 OpenMarket Ltd
|
Copyright 2016 OpenMarket Ltd
|
||||||
|
Copyright 2021 New Vector Ltd
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -15,23 +16,21 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
title?: string;
|
||||||
|
// `src` to an image. Optional.
|
||||||
|
icon?: string;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A stripped-down room header used for things like the user settings
|
* A stripped-down room header used for things like the user settings
|
||||||
* and room directory.
|
* and room directory.
|
||||||
*/
|
*/
|
||||||
@replaceableComponent("views.rooms.SimpleRoomHeader")
|
@replaceableComponent("views.rooms.SimpleRoomHeader")
|
||||||
export default class SimpleRoomHeader extends React.Component {
|
export default class SimpleRoomHeader extends React.PureComponent<IProps> {
|
||||||
static propTypes = {
|
public render(): JSX.Element {
|
||||||
title: PropTypes.string,
|
|
||||||
|
|
||||||
// `src` to an image. Optional.
|
|
||||||
icon: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
let icon;
|
let icon;
|
||||||
if (this.props.icon) {
|
if (this.props.icon) {
|
||||||
icon = <img
|
icon = <img
|
Loading…
Reference in a new issue