Skip to content

Commit 2b03071

Browse files
committed
next dropdown pages working and updating
1 parent 22b5887 commit 2b03071

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app/src/components/main/AddLink.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ function AddLink({ id }: AddRoutes) {
2323
}
2424

2525
const handlePageSelect = event => {
26-
const selectedPageName = event.target.value;
27-
state.components[0].children.forEach(element => {
26+
const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
27+
currComponent.children.forEach(element => {
2828
if(element.childId === id) {
2929
element.attributes.compLink = event.target.value;
30+
dispatch({type: 'UPDATE ATTRIBUTES', payload: element})
3031
}
3132
});
3233
// selectedPageName.compLink = event.target.value;
@@ -36,13 +37,13 @@ function AddLink({ id }: AddRoutes) {
3637
let pagesItems = state.components.filter(comp => state.rootComponents.includes(comp.id));
3738
let dropDown = pagesItems.map(comp => <MenuItem value={comp.name}>{comp.name}</MenuItem>);
3839
return (
39-
<div style={{ padding: '1px', float: 'right' }}>
40+
<div style={{paddingBottom: '1px', float: 'right' }}>
4041
<FormControl size='small'>
4142
<InputLabel style={ { color: isThemeLight? '#000' : '#fff'} }>Pages</InputLabel>
4243
<Select variant="outlined"
4344
onChange={handlePageSelect}
4445
id="page-select"
45-
style={ isThemeLight? {backgroundColor: '#eef0f1', color: '#000', border: '1px solid black'} : {backgroundColor: 'gray', color: '#fff', border: '1px solid white'}}
46+
style={ isThemeLight? {backgroundColor: '#eef0f1', color: '#000', border: '1px solid black', height: '28px', width: '200px'} : {backgroundColor: 'gray', color: '#fff', border: '1px solid white', height: '28px', width: '200px'}}
4647
>
4748
{dropDown}
4849
</Select>

app/src/components/right/StatePropsPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ const useStyles = makeStyles((theme: Theme) =>
321321
borderBottom: '1px solid white'
322322
},
323323
rootUnderlineDark: {
324-
'& .MuiSelect-icon': {
324+
'& .-icon': {
325325
color: '#fff',
326326
},
327327
'&::before': {
328328
borderBottom: '1px solid #fff'
329329
}
330330
},
331331
rootUnderlineLight: {
332-
'& .MuiSelect-icon': {
332+
'& .-icon': {
333333
color: 'rgba(0,0,0,0.54)',
334334
},
335335
'&::before': {

app/src/containers/CustomizationPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
711711
const useStyles = makeStyles({
712712
select: {
713713
fontSize: '1em',
714-
'> .MuiSelect-icon': {
714+
'> .-icon': {
715715
color: '#155084'
716716
}
717717
},

app/src/helperFunctions/generateCode.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const generateUnformattedCode = (
8383
) {
8484
child.children = getEnrichedChildren(child);
8585
}
86-
console.log('referencedHTML', referencedHTML.tag);
86+
8787
// when we see a Switch or LinkTo, import React Router
8888
if (referencedHTML.tag === 'Switch' || (referencedHTML.tag === 'Link' && projectType === 'Classic React'))
8989
importReactRouter = true;
@@ -93,7 +93,6 @@ const generateUnformattedCode = (
9393
images = true;
9494
return child;
9595
} else if (child.type === 'Route Link') {
96-
console.log('hit');
9796
links = true;
9897
child.name = components.find(
9998
(comp: Component) => comp.id === child.typeId

0 commit comments

Comments
 (0)