2015-11-27 10:42:03 +00:00
|
|
|
/*
|
2023-08-01 08:32:53 +01:00
|
|
|
Copyright 2023 The Matrix.org Foundation C.I.C.
|
2015-11-27 10:42:03 +00:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-08-01 08:32:53 +01:00
|
|
|
import React from "react";
|
2021-12-09 09:10:23 +00:00
|
|
|
|
2022-09-25 10:57:25 -04:00
|
|
|
import type { Room } from "matrix-js-sdk/src/models/room";
|
2021-07-01 19:54:05 +01:00
|
|
|
import { IOOBData } from "../../../stores/ThreepidInviteStore";
|
2023-08-01 14:47:09 +01:00
|
|
|
import { useRoomName } from "../../../hooks/useRoomName";
|
2022-09-25 10:57:25 -04:00
|
|
|
|
2023-08-01 08:32:53 +01:00
|
|
|
export default function RoomHeader({ room, oobData }: { room?: Room; oobData?: IOOBData }): JSX.Element {
|
2023-08-01 14:47:09 +01:00
|
|
|
const roomName = useRoomName(room, oobData);
|
2022-09-25 10:57:25 -04:00
|
|
|
|
|
|
|
|
return (
|
2023-08-01 14:47:09 +01:00
|
|
|
<header className="mx_RoomHeader light-panel">
|
|
|
|
|
<div className="mx_RoomHeader_wrapper">
|
|
|
|
|
<div className="mx_RoomHeader_name" dir="auto" title={roomName} role="heading" aria-level={1}>
|
|
|
|
|
{roomName}
|
|
|
|
|
</div>
|
2023-08-01 08:32:53 +01:00
|
|
|
</div>
|
|
|
|
|
</header>
|
2022-09-25 10:57:25 -04:00
|
|
|
);
|
2020-08-29 12:14:16 +01:00
|
|
|
}
|