1- import React , { useEffect , useState } from 'react' ;
2- import { useDrop , DropTargetMonitor } from 'react-dnd' ;
3- import { ItemTypes } from '../../constants/ItemTypes' ;
41import { Component , DragItem } from '../../interfaces/Interfaces' ;
5- import { combineStyles } from '../../helperFunctions/combineStyles' ;
6- import renderChildren from '../../helperFunctions/renderChildren' ;
7- import Arrow from './Arrow' ;
8- import { useDispatch , useSelector } from 'react-redux' ;
2+ import { DropTargetMonitor , useDrop } from 'react-dnd' ;
3+ import React , { useEffect , useState } from 'react' ;
94import {
10- changeFocus ,
115 addChild ,
6+ changeFocus ,
127 snapShotAction ,
138 toggleCodePreview
149} from '../../redux/reducers/slice/appStateSlice' ;
10+ import { useDispatch , useSelector } from 'react-redux' ;
11+
12+ import Arrow from './Arrow' ;
13+ import { ItemTypes } from '../../constants/ItemTypes' ;
1514import { RootState } from '../../redux/store' ;
15+ import { combineStyles } from '../../helperFunctions/combineStyles' ;
16+ import renderChildren from '../../helperFunctions/renderChildren' ;
1617
1718function Canvas ( props ) : JSX . Element {
1819 const { state, contextParam, isDarkMode } = useSelector (
1920 ( store : RootState ) => ( {
2021 state : store . appState ,
2122 contextParam : store . contextSlice ,
22- isDarkMode : store . darkMode . isDarkMode ,
23+ isDarkMode : store . darkMode . isDarkMode
2324 } )
2425 ) ;
2526 const dispatch = useDispatch ( ) ;
@@ -128,7 +129,7 @@ function Canvas(props): JSX.Element {
128129 width : '100%' ,
129130 minHeight : '100%' ,
130131 backgroundColor : isOver ? '#191919' : '#191919' ,
131- border : '1px solid #FBFBF2' ,
132+ // border: '1px solid #FBFBF2',
132133 borderStyle : isOver ? 'dotted' : 'solid' ,
133134 aspectRatio : 'auto 774 / 1200' ,
134135 boxSizing : 'border-box'
@@ -151,15 +152,15 @@ function Canvas(props): JSX.Element {
151152 currentComponent . style
152153 ) ;
153154 return (
154- < div
155- className = { 'componentContainer' }
156- ref = { drop }
157- data-testid = "drop"
158- style = { ! isDarkMode ? canvasStyle : darkCombinedCanvasStyle }
159- onClick = { onClickHandler }
160- >
161- { renderChildren ( currentComponent . children ) }
162- </ div >
155+ < div
156+ className = { 'componentContainer' }
157+ ref = { drop }
158+ data-testid = "drop"
159+ style = { ! isDarkMode ? canvasStyle : darkCombinedCanvasStyle }
160+ onClick = { onClickHandler }
161+ >
162+ { renderChildren ( currentComponent . children ) }
163+ </ div >
163164 ) ;
164165}
165166
0 commit comments