Skip to content

Commit

Permalink
fix: 🐛 multi select
Browse files Browse the repository at this point in the history
  • Loading branch information
AruSeito committed Feb 28, 2024
1 parent b635c56 commit 9e46676
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions apps/builder/src/components/Guide/WidgetStepMask/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
UNIT_HEIGHT,
} from "@/page/App/components/DotPanel/constant/canvas"
import { getCanvasShape } from "@/redux/config/configSelector"
import { WidgetConfigMap } from "@/widgetLibrary/widgetBuilder"
import { widgetBuilder } from "@/widgetLibrary/widgetBuilder"

export interface StepMaskProps {
currentStep: number
Expand All @@ -34,7 +34,7 @@ export const WidgetStepMask: FC<StepMaskProps> = (props) => {

const widgetShape = useMemo(() => {
return GUIDE_SELECT_WIDGET.map((widget) => {
const { w, h } = WidgetConfigMap[widget].config
const { w, h } = widgetBuilder(widget).config
return {
width: w * unitWidth,
height: h * UNIT_HEIGHT,
Expand Down
8 changes: 4 additions & 4 deletions apps/builder/src/config/guide/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import { componentsActions } from "@/redux/currentApp/components/componentsSlice
import { guideActions } from "@/redux/guide/guideSlice"
import store from "@/store"
import { DisplayNameGenerator } from "@/utils/generators/generateDisplayName"
import { WidgetConfigMap } from "@/widgetLibrary/widgetBuilder"
import { widgetBuilder } from "@/widgetLibrary/widgetBuilder"

export const SELECT_WIDGET_ITEM = {
INPUT_WIDGET: {
highlightIcon: InputHighlightIcon,
...WidgetConfigMap["INPUT_WIDGET"].config,
...widgetBuilder("INPUT_WIDGET").config,
},
BUTTON_WIDGET: {
highlightIcon: ButtonHighlightIcon,
...WidgetConfigMap["BUTTON_WIDGET"].config,
...widgetBuilder("BUTTON_WIDGET").config,
},
DATA_GRID_WIDGET: {
highlightIcon: TableHighlightIcon,
...WidgetConfigMap["DATA_GRID_WIDGET"].config,
...widgetBuilder("DATA_GRID_WIDGET").config,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WrapperContainerProps } from "./interface"
import { applyWrapperPendingStyle, hoverHotSpotStyle } from "./style"

const WrapperContainer: FC<WrapperContainerProps> = (props) => {
const { displayName, parentNodeDisplayName, widgetHeight, children } = props
const { displayName, widgetHeight, children } = props
const executionResult = useSelector(getExecutionResult)

const selectedComponents = useSelector(getSelectedComponentDisplayNames)
Expand All @@ -39,11 +39,7 @@ const WrapperContainer: FC<WrapperContainerProps> = (props) => {
realProps?.dynamicMinHeight === widgetHeight)

return (
<div
css={hoverHotSpotStyle}
data-displayname={displayName}
data-parentnode={parentNodeDisplayName}
>
<div css={hoverHotSpotStyle}>
<div
css={applyWrapperPendingStyle({
hasError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ReactNode } from "react"

export interface WrapperContainerProps {
displayName: string
parentNodeDisplayName: string
widgetHeight: number
children: ReactNode
}
6 changes: 1 addition & 5 deletions apps/builder/src/page/App/components/ScaleSquare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ const ScaleSquare: FC<ScaleSquareProps> = (props) => {
widgetType={widgetType}
columnNumber={columnNumber}
>
<WrapperContainer
displayName={displayName}
parentNodeDisplayName={parentNodeDisplayName}
widgetHeight={height}
>
<WrapperContainer displayName={displayName} widgetHeight={height}>
<TransformWidgetWrapper
displayName={displayName}
widgetType={widgetType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ export const ModalScaleSquare: FC<ScaleSquareProps> = (props) => {
columnNumber={columnNumber}
unitWidth={unitW}
>
<WrapperContainer
displayName={displayName}
parentNodeDisplayName={parentNodeDisplayName}
widgetHeight={height}
>
<WrapperContainer displayName={displayName} widgetHeight={height}>
<TransformWidgetWrapper
displayName={displayName}
widgetType={widgetType}
Expand Down

0 comments on commit 9e46676

Please sign in to comment.