Skip to content

Commit

Permalink
refactor: extract constants into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Devessier committed Jan 23, 2025
1 parent fa06fe3 commit 7126822
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { NODE_BORDER_WIDTH } from '@/workflow/workflow-diagram/constants/NodeBorderWidth';
import { NODE_HANDLE_HEIGHT_PX } from '@/workflow/workflow-diagram/constants/NodeHandleHeightPx';
import { NODE_HANDLE_WIDTH_PX } from '@/workflow/workflow-diagram/constants/NodeHandleWidthPx';
import { NODE_ICON_LEFT_MARGIN } from '@/workflow/workflow-diagram/constants/NodeIconLeftMargin';
import { NODE_ICON_WIDTH } from '@/workflow/workflow-diagram/constants/NodeIconWidth';
import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
import styled from '@emotion/styled';
import { Handle, Position } from '@xyflow/react';
import React from 'react';
import { capitalize } from 'twenty-shared';
import { isDefined, OverflowingTextWithTooltip, THEME_COMMON } from 'twenty-ui';
import { isDefined, OverflowingTextWithTooltip } from 'twenty-ui';

type Variant = 'placeholder';

const NODE_HANDLE_WIDTH_PX = 4;
const NODE_HANDLE_HEIGHT_PX = NODE_HANDLE_WIDTH_PX;
export const NODE_ICON_WIDTH = Number(
THEME_COMMON.spacing(6).replace('px', ''),
);
export const NODE_ICON_LEFT_MARGIN = Number(
THEME_COMMON.spacing(2).replace('px', ''),
);
export const NODE_BORDER_WIDTH = 1;

const StyledStepNodeContainer = styled.div`
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
NODE_BORDER_WIDTH,
NODE_ICON_LEFT_MARGIN,
NODE_ICON_WIDTH,
StyledHandle,
} from '@/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode';
import { StyledHandle } from '@/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode';
import { NODE_BORDER_WIDTH } from '@/workflow/workflow-diagram/constants/NodeBorderWidth';
import { NODE_ICON_LEFT_MARGIN } from '@/workflow/workflow-diagram/constants/NodeIconLeftMargin';
import { NODE_ICON_WIDTH } from '@/workflow/workflow-diagram/constants/NodeIconWidth';
import styled from '@emotion/styled';
import { Position } from '@xyflow/react';
import { IconButton, IconPlus } from 'twenty-ui';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const NODE_BORDER_WIDTH = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { NODE_HANDLE_WIDTH_PX } from './NodeHandleWidthPx';

export const NODE_HANDLE_HEIGHT_PX = NODE_HANDLE_WIDTH_PX;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const NODE_HANDLE_WIDTH_PX = 4;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { THEME_COMMON } from 'twenty-ui';

export const NODE_ICON_LEFT_MARGIN = Number(
THEME_COMMON.spacing(2).replace('px', ''),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { THEME_COMMON } from 'twenty-ui';

export const NODE_ICON_WIDTH = Number(
THEME_COMMON.spacing(6).replace('px', ''),
);

0 comments on commit 7126822

Please sign in to comment.