Files
ThreadNet-Web/src/components/views/location/ShareDialogButtons.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.6 KiB
TypeScript
Raw Normal View History

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";
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";
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"
data-testid="share-dialog-buttons-back"
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"
data-testid="share-dialog-buttons-cancel"
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;