2016-02-24 17:26:34 +00:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
|
|
|
|
Copyright 2016-2021 The Matrix.org Foundation C.I.C.
|
2016-02-24 17:26:34 +00:00
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2016-02-24 17:26:34 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-09-06 15:04:46 +01:00
|
|
|
import React from "react";
|
2025-12-04 13:04:13 +00:00
|
|
|
import { ChevronUpIcon, CloseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
2021-10-22 17:23:32 -05:00
|
|
|
|
2017-05-25 11:39:08 +01:00
|
|
|
import { _t } from "../../../languageHandler";
|
2025-02-05 13:25:06 +00:00
|
|
|
import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton";
|
2018-12-03 14:55:24 +01:00
|
|
|
|
2021-08-14 10:51:08 +02:00
|
|
|
interface IProps {
|
2023-05-12 09:49:37 +01:00
|
|
|
onScrollUpClick: (e: ButtonEvent) => void;
|
|
|
|
|
onCloseClick: (e: ButtonEvent) => void;
|
2021-08-14 10:51:08 +02:00
|
|
|
}
|
2016-02-24 17:26:34 +00:00
|
|
|
|
2021-08-14 10:51:08 +02:00
|
|
|
export default class TopUnreadMessagesBar extends React.PureComponent<IProps> {
|
2023-02-13 17:01:43 +00:00
|
|
|
public render(): React.ReactNode {
|
2016-02-24 17:26:34 +00:00
|
|
|
return (
|
|
|
|
|
<div className="mx_TopUnreadMessagesBar">
|
2021-07-23 10:23:45 +01:00
|
|
|
<AccessibleButton
|
|
|
|
|
className="mx_TopUnreadMessagesBar_scrollUp"
|
2023-09-29 08:49:26 +01:00
|
|
|
title={_t("room|jump_read_marker")}
|
2021-07-23 10:23:45 +01:00
|
|
|
onClick={this.props.onScrollUpClick}
|
2025-12-04 13:04:13 +00:00
|
|
|
>
|
|
|
|
|
<ChevronUpIcon />
|
|
|
|
|
</AccessibleButton>
|
2021-07-23 10:23:45 +01:00
|
|
|
<AccessibleButton
|
|
|
|
|
className="mx_TopUnreadMessagesBar_markAsRead"
|
2023-09-26 13:04:17 +01:00
|
|
|
title={_t("notifications|mark_all_read")}
|
2021-07-23 10:23:45 +01:00
|
|
|
onClick={this.props.onCloseClick}
|
2025-12-04 13:04:13 +00:00
|
|
|
>
|
|
|
|
|
<CloseIcon />
|
|
|
|
|
</AccessibleButton>
|
2016-02-24 17:26:34 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
2020-08-29 12:14:16 +01:00
|
|
|
}
|
|
|
|
|
}
|