2022-03-03 11:30:46 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2022-03-03 11:30:46 +01:00
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2024-09-09 14:57:16 +01:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2022-03-03 11:30:46 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
2024-10-15 11:19:06 +01:00
|
|
|
import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close";
|
|
|
|
|
import BackIcon from "@vector-im/compound-design-tokens/assets/web/icons/chevron-left";
|
2022-03-03 11:30:46 +01:00
|
|
|
|
|
|
|
|
import AccessibleButton from "../elements/AccessibleButton";
|
2023-02-21 07:35:39 +13:00
|
|
|
import { _t } from "../../../languageHandler";
|
2022-03-03 11:30:46 +01:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
onCancel: () => void;
|
|
|
|
|
onBack: () => void;
|
|
|
|
|
displayBack?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ShareDialogButtons: React.FC<Props> = ({ onBack, onCancel, displayBack }) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="mx_ShareDialogButtons">
|
|
|
|
|
{displayBack && (
|
|
|
|
|
<AccessibleButton
|
|
|
|
|
className="mx_ShareDialogButtons_button left"
|
2023-02-21 07:35:39 +13:00
|
|
|
data-testid="share-dialog-buttons-back"
|
2023-08-23 11:57:22 +01:00
|
|
|
aria-label={_t("action|back")}
|
2022-03-03 11:30:46 +01:00
|
|
|
onClick={onBack}
|
|
|
|
|
element="button"
|
2022-12-12 12:24:14 +01:00
|
|
|
>
|
2022-03-03 11:30:46 +01:00
|
|
|
<BackIcon className="mx_ShareDialogButtons_button-icon" />
|
|
|
|
|
</AccessibleButton>
|
2022-12-12 12:24:14 +01:00
|
|
|
)}
|
2022-03-03 11:30:46 +01:00
|
|
|
<AccessibleButton
|
|
|
|
|
className="mx_ShareDialogButtons_button right"
|
2023-02-21 07:35:39 +13:00
|
|
|
data-testid="share-dialog-buttons-cancel"
|
2023-08-23 11:57:22 +01:00
|
|
|
aria-label={_t("action|close")}
|
2022-03-03 11:30:46 +01:00
|
|
|
onClick={onCancel}
|
|
|
|
|
element="button"
|
|
|
|
|
>
|
|
|
|
|
<CloseIcon className="mx_ShareDialogButtons_button-icon" />
|
|
|
|
|
</AccessibleButton>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ShareDialogButtons;
|