Files
ThreadNet-Web/src/components/views/elements/ResizeHandle.tsx
T

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

37 lines
1.1 KiB
TypeScript
Raw Normal View History

/*
2024-09-09 14:57:16 +01:00
Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C.
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.
*/
import React from "react"; // eslint-disable-line no-unused-vars
//see src/resizer for the actual resizing code, this is just the DOM for the resize handle
2021-08-24 11:15:41 +02:00
interface IResizeHandleProps {
vertical?: boolean;
reverse?: boolean;
2021-08-24 11:15:41 +02:00
id?: string;
2021-08-24 13:05:46 +02:00
passRef?: React.RefObject<HTMLDivElement>;
2021-08-24 11:15:41 +02:00
}
const ResizeHandle: React.FC<IResizeHandleProps> = ({ vertical, reverse, id, passRef }) => {
const classNames = ["mx_ResizeHandle"];
2021-08-24 11:15:41 +02:00
if (vertical) {
2023-05-04 15:19:55 +00:00
classNames.push("mx_ResizeHandle--vertical");
} else {
2023-05-04 15:19:55 +00:00
classNames.push("mx_ResizeHandle--horizontal");
}
if (reverse) {
classNames.push("mx_ResizeHandle_reverse"); // required for the resizer of the third pinned widget to work
}
return (
2021-08-24 13:05:46 +02:00
<div ref={passRef} className={classNames.join(" ")} data-id={id}>
<div />
</div>
);
};
export default ResizeHandle;