Skip to content

Commit f548d8d

Browse files
authored
Merge pull request #1125 from saurabhraghuvanshii/resize
added resize icon
2 parents b19f141 + 2d346c2 commit f548d8d

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

src/custom/Panel/Panel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Resizable } from 're-resizable';
22
import React from 'react';
33
import Draggable from 'react-draggable';
44
import { Box, BoxProps, Tooltip } from '../../base';
5-
import { CloseIcon, CollapseAllIcon, ExpandAllIcon, FullScreenIcon } from '../../icons';
5+
import { CloseIcon, CollapseAllIcon, ExpandAllIcon, FullScreenIcon, ResizeIcon } from '../../icons';
66
import { useTheme } from '../../theme';
77
import { ErrorBoundary } from '../ErrorBoundary';
88
import {
@@ -14,7 +14,8 @@ import {
1414
PanelBody,
1515
PanelContainer,
1616
PanelTitle,
17-
ResizableContent
17+
ResizableContent,
18+
ResizeIconContainer
1819
} from './style';
1920

2021
export type PanelProps = {
@@ -108,6 +109,9 @@ const Panel_: React.FC<PanelProps> = ({
108109
</div>
109110
<PanelBody className="panel-body">{children}</PanelBody>
110111
</ErrorBoundary>
112+
<ResizeIconContainer>
113+
<ResizeIcon />
114+
</ResizeIconContainer>
111115
</ResizableContent>
112116
</Resizable>
113117
</PanelContainer>

src/custom/Panel/style.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,17 @@ export const PanelTitle = styled('div')(() => ({
129129
marginInline: 'auto',
130130
width: 'fit-content'
131131
}));
132+
133+
export const ResizeIconContainer = styled('div')(({ theme }) => ({
134+
position: 'absolute',
135+
bottom: '2px',
136+
left: '4px',
137+
pointerEvents: 'none',
138+
'& svg': {
139+
width: '18px',
140+
height: '18px',
141+
stroke: 'currentColor',
142+
fill: 'currentColor',
143+
color: theme.palette.text.primary
144+
}
145+
}));

src/icons/Resize/ResizeIcon.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { FC } from 'react';
2+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
3+
import { IconProps } from '../types';
4+
5+
export const ResizeIcon: FC<IconProps> = ({
6+
width = DEFAULT_WIDTH,
7+
height = DEFAULT_HEIGHT,
8+
...props
9+
}) => {
10+
return (
11+
<svg
12+
width={width}
13+
height={height}
14+
xmlns="http://www.w3.org/2000/svg"
15+
viewBox="0 0 512 512"
16+
{...props}
17+
>
18+
<path d="M418.3 80H307.8c-7.5 0-13.7 6.1-13.7 13.7v.2c0 7.5 6.1 13.7 13.7 13.7h76.5L107.6 384.3v-76.5c0-7.5-6.1-13.7-13.7-13.7h-.2c-7.5 0-13.7 6.1-13.7 13.7v110.5c0 7.5 6.1 13.7 13.7 13.7h110.5c7.5 0 13.7-6.1 13.7-13.7v-.2c0-7.5-6.1-13.7-13.7-13.7h-76.5l276.7-276.7v76.5c0 7.5 6.1 13.7 13.7 13.7h.2c7.5 0 13.7-6.1 13.7-13.7V93.7c0-7.6-6.1-13.7-13.7-13.7z" />
19+
</svg>
20+
);
21+
};
22+
23+
export default ResizeIcon;

src/icons/Resize/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ResizeIcon } from './ResizeIcon';

src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export * from './Rectangle';
9999
export * from './Redo';
100100
export * from './Remove';
101101
export * from './Reset';
102+
export * from './Resize';
102103
export * from './RightArrow';
103104
export * from './Ring';
104105
export * from './Save';

0 commit comments

Comments
 (0)