Skip to content

Commit 464e04e

Browse files
committed
demorender link click disabled
1 parent 889bba7 commit 464e04e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app/src/components/main/DemoRender.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ const DemoRender = (): JSX.Element => {
6666
}
6767
if (elementType === 'input') componentsToRender.push(<Box component={elementType} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}></Box>);
6868
else if (elementType === 'img') componentsToRender.push(<Box component={elementType} src={activeLink} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}></Box>);
69-
else if (elementType === 'a' || elementType === 'Link') componentsToRender.push(<Box component={'a'} href={activeLink} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>);
69+
else if (elementType === 'a') componentsToRender.push(<Box component={elementType} href='javascript:void(0)' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>);
7070
else if (elementType === 'Switch') componentsToRender.push(<Switch>{renderedChildren}</Switch>);
7171
else if (elementType === 'Route') componentsToRender.push(<Route exact path={activeLink}>{renderedChildren}</Route>);
72-
// else if (elementType === 'LinkTo') componentsToRender.push(<Link to={activeLink}>{innerText}</Link>);
72+
else if (elementType === 'Link') componentsToRender.push(<Box component='a' href='javascript:void(0)' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>)/*componentsToRender.push(<Link to={activeLink}>{innerText}</Link>);*/
7373
else componentsToRender.push(<Box component={elementType} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}{renderedChildren}</Box>);
7474
key += 1;
7575
}
@@ -78,12 +78,9 @@ const DemoRender = (): JSX.Element => {
7878
};
7979

8080
let code = '';
81-
const currComponent = state.components.filter(element => element.id === state.canvasFocus.componentId);
82-
componentBuilder(currComponent[0].children).forEach(element => {
81+
const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
82+
componentBuilder(currComponent.children).forEach(element => {
8383
try{
84-
if(element.props.component === 'Link') {
85-
86-
}
8784
code += ReactDOMServer.renderToString(element)
8885
} catch {
8986
return;

0 commit comments

Comments
 (0)