2016-03-29 14:51:46 +03:00
|
|
|
/*
|
|
|
|
Copyright 2016 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2017-01-25 19:05:39 +03:00
|
|
|
import React from 'react';
|
2017-12-26 04:03:18 +03:00
|
|
|
import PropTypes from 'prop-types';
|
2019-12-20 04:19:56 +03:00
|
|
|
import * as sdk from '../../../index';
|
2021-03-09 06:12:00 +03:00
|
|
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
2016-03-29 14:51:46 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A stripped-down room header used for things like the user settings
|
|
|
|
* and room directory.
|
|
|
|
*/
|
2021-03-09 06:12:00 +03:00
|
|
|
@replaceableComponent("views.rooms.SimpleRoomHeader")
|
2020-08-29 14:14:16 +03:00
|
|
|
export default class SimpleRoomHeader extends React.Component {
|
|
|
|
static propTypes = {
|
2017-12-26 04:03:18 +03:00
|
|
|
title: PropTypes.string,
|
2016-09-13 21:00:35 +03:00
|
|
|
|
2017-04-27 19:57:13 +03:00
|
|
|
// `src` to a TintableSvg. Optional.
|
2017-12-26 04:03:18 +03:00
|
|
|
icon: PropTypes.string,
|
2020-08-29 14:14:16 +03:00
|
|
|
};
|
2016-09-13 21:00:35 +03:00
|
|
|
|
2020-08-29 14:14:16 +03:00
|
|
|
render() {
|
2017-04-27 19:57:13 +03:00
|
|
|
let icon;
|
|
|
|
if (this.props.icon) {
|
|
|
|
const TintableSvg = sdk.getComponent('elements.TintableSvg');
|
|
|
|
icon = <TintableSvg
|
|
|
|
className="mx_RoomHeader_icon" src={this.props.icon}
|
|
|
|
width="25" height="25"
|
|
|
|
/>;
|
|
|
|
}
|
2016-04-16 00:16:19 +03:00
|
|
|
|
2016-03-29 14:51:46 +03:00
|
|
|
return (
|
2021-05-20 18:11:33 +03:00
|
|
|
<div className="mx_RoomHeader mx_RoomHeader_wrapper" >
|
|
|
|
<div className="mx_RoomHeader_simpleHeader">
|
|
|
|
{ icon }
|
|
|
|
{ this.props.title }
|
2016-03-30 01:21:17 +03:00
|
|
|
</div>
|
2016-03-29 14:51:46 +03:00
|
|
|
</div>
|
|
|
|
);
|
2020-08-29 14:14:16 +03:00
|
|
|
}
|
|
|
|
}
|