mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-21 15:49:15 +01:00
3c8134184b
Enables the same `no-unexternalized-strings` with have in `vscode` in this repo. This make sure we have a more consistent style across repos and when generating edits
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as React from 'react';
|
|
|
|
interface DraggableBottomBorderProps {
|
|
height: number;
|
|
setHeight: React.Dispatch<React.SetStateAction<number>>;
|
|
}
|
|
|
|
export const DraggableBottomBorder: React.FC<DraggableBottomBorderProps> = ({ height, setHeight }) => {
|
|
const handleMouseDown = (e: React.MouseEvent) => {
|
|
const startY = e.clientY;
|
|
const startHeight = height;
|
|
|
|
const handleMouseMove = (e: MouseEvent) => {
|
|
const newHeight = startHeight + (e.clientY - startY);
|
|
setHeight(newHeight);
|
|
};
|
|
|
|
const handleMouseUp = () => {
|
|
document.removeEventListener('mousemove', handleMouseMove);
|
|
document.removeEventListener('mouseup', handleMouseUp);
|
|
};
|
|
|
|
document.addEventListener('mousemove', handleMouseMove);
|
|
document.addEventListener('mouseup', handleMouseUp);
|
|
};
|
|
|
|
return (
|
|
<div
|
|
className='file-editor-draggable-border'
|
|
onMouseDown={handleMouseDown}
|
|
></div>
|
|
);
|
|
};
|