Skip to content

added resize icon #1125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/custom/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Resizable } from 're-resizable';
import React from 'react';
import Draggable from 'react-draggable';
import { Box, BoxProps, Tooltip } from '../../base';
import { CloseIcon, CollapseAllIcon, ExpandAllIcon, FullScreenIcon } from '../../icons';
import { CloseIcon, CollapseAllIcon, ExpandAllIcon, FullScreenIcon, ResizeIcon } from '../../icons';
import { useTheme } from '../../theme';
import { ErrorBoundary } from '../ErrorBoundary';
import {
Expand All @@ -14,7 +14,8 @@ import {
PanelBody,
PanelContainer,
PanelTitle,
ResizableContent
ResizableContent,
ResizeIconContainer
} from './style';

export type PanelProps = {
Expand Down Expand Up @@ -108,6 +109,9 @@ const Panel_: React.FC<PanelProps> = ({
</div>
<PanelBody className="panel-body">{children}</PanelBody>
</ErrorBoundary>
<ResizeIconContainer>
<ResizeIcon />
</ResizeIconContainer>
</ResizableContent>
</Resizable>
</PanelContainer>
Expand Down
14 changes: 14 additions & 0 deletions src/custom/Panel/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,17 @@ export const PanelTitle = styled('div')(() => ({
marginInline: 'auto',
width: 'fit-content'
}));

export const ResizeIconContainer = styled('div')(({ theme }) => ({
position: 'absolute',
bottom: '2px',
left: '4px',
pointerEvents: 'none',
'& svg': {
width: '18px',
height: '18px',
stroke: 'currentColor',
fill: 'currentColor',
color: theme.palette.text.primary
}
}));
23 changes: 23 additions & 0 deletions src/icons/Resize/ResizeIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { FC } from 'react';
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
import { IconProps } from '../types';

export const ResizeIcon: FC<IconProps> = ({
width = DEFAULT_WIDTH,
height = DEFAULT_HEIGHT,
...props
}) => {
return (
<svg
width={width}
height={height}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
{...props}
>
<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" />
</svg>
);
};

export default ResizeIcon;
1 change: 1 addition & 0 deletions src/icons/Resize/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ResizeIcon } from './ResizeIcon';
1 change: 1 addition & 0 deletions src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export * from './Rectangle';
export * from './Redo';
export * from './Remove';
export * from './Reset';
export * from './Resize';
export * from './RightArrow';
export * from './Ring';
export * from './Save';
Expand Down