diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx index 5382e897ed2..505bada3691 100644 --- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx +++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx @@ -1,5 +1,6 @@ import { PageLayoutGridLayoutDragSelector } from '@/page-layout/components/PageLayoutGridLayoutDragSelector'; import { PageLayoutGridOverlay } from '@/page-layout/components/PageLayoutGridOverlay'; +import { PageLayoutGridResizeHandle } from '@/page-layout/components/PageLayoutGridResizeHandle'; import { EMPTY_LAYOUT } from '@/page-layout/constants/EmptyLayout'; import { PAGE_LAYOUT_CONFIG, @@ -115,6 +116,10 @@ export const PageLayoutGridLayout = () => { draggableHandle=".drag-handle" compactType="vertical" preventCollision={false} + resizeHandle={ + isPageLayoutInEditMode ? : undefined + } + resizeHandles={['se']} onLayoutChange={handleLayoutChange} onBreakpointChange={(newBreakpoint) => setPageLayoutCurrentBreakpoint( diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridResizeHandle.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridResizeHandle.tsx new file mode 100644 index 00000000000..c125a131297 --- /dev/null +++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridResizeHandle.tsx @@ -0,0 +1,55 @@ +import { useTheme } from '@emotion/react'; +import styled from '@emotion/styled'; +import { forwardRef } from 'react'; +import { IconRadiusBottomRight } from 'twenty-ui/display'; + +type PageLayoutGridResizeHandleProps = { + handleAxis?: string; + onMouseDown?: React.MouseEventHandler; + onMouseUp?: React.MouseEventHandler; + onTouchEnd?: React.TouchEventHandler; + className?: string; + style?: React.CSSProperties; +}; + +const StyledIcon = styled(IconRadiusBottomRight)` + bottom: ${({ theme }) => theme.spacing(1)}; + cursor: nwse-resize; + position: absolute; + right: ${({ theme }) => theme.spacing(1)}; + color: ${({ theme }) => theme.border.color.strong}; + + :hover { + color: ${({ theme }) => theme.font.color.tertiary}; + } +`; + +export const PageLayoutGridResizeHandle = forwardRef< + HTMLDivElement, + PageLayoutGridResizeHandleProps +>((props, ref) => { + const theme = useTheme(); + const { + handleAxis = 'se', + onMouseDown, + onMouseUp, + onTouchEnd, + className, + style, + } = props; + + if (handleAxis !== 'se') return null; + + return ( +
+ +
+ ); +}); diff --git a/packages/twenty-ui/src/display/icon/components/TablerIcons.ts b/packages/twenty-ui/src/display/icon/components/TablerIcons.ts index a6f62a76ed4..ecfc418f696 100644 --- a/packages/twenty-ui/src/display/icon/components/TablerIcons.ts +++ b/packages/twenty-ui/src/display/icon/components/TablerIcons.ts @@ -272,6 +272,7 @@ export { IconProgressCheck, IconPuzzle, IconQuestionMark, + IconRadiusBottomRight, IconRefresh, IconRefreshAlert, IconRefreshDot, diff --git a/packages/twenty-ui/src/display/index.ts b/packages/twenty-ui/src/display/index.ts index 5c7c674f535..cf9fe6dac51 100644 --- a/packages/twenty-ui/src/display/index.ts +++ b/packages/twenty-ui/src/display/index.ts @@ -334,6 +334,7 @@ export { IconProgressCheck, IconPuzzle, IconQuestionMark, + IconRadiusBottomRight, IconRefresh, IconRefreshAlert, IconRefreshDot,