Skip to content

Commit 57ad211

Browse files
authored
Merge pull request #24 from oslabs-beta/katrina1
fixed drop down modal text color
2 parents 3ae3817 + c3608fb commit 57ad211

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

app/src/components/main/AddLink.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ function AddLink({ id, onClickHandler, linkDisplayed }) {
1414
const [state, dispatch] = useContext(StateContext);
1515
const [link, setLink] = useState('')
1616

17+
function deepIterate(arr) {
18+
const output = [];
19+
for(let i = 0; i < arr.length; i++) {
20+
if(arr[i].typeId === 1000) continue;
21+
output.push(arr[i]);
22+
if(arr[i].children.length) {
23+
output.push(...deepIterate(arr[i].children));
24+
}
25+
}
26+
return output;
27+
}
28+
1729
const handlePageSelect = event => {
18-
console.log('hit');
1930
const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
20-
currComponent.children.some(element => {
31+
deepIterate(currComponent.children).some(element => {
2132
if(element.childId === id) {
2233
const state = JSON.parse(JSON.stringify(element));
2334
state.childId = id;
@@ -30,7 +41,7 @@ function AddLink({ id, onClickHandler, linkDisplayed }) {
3041

3142

3243
const pagesItems = state.components.filter(comp => state.rootComponents.includes(comp.id));
33-
const dropDown = [<MenuItem style={{ color: isThemeLight? '#000' : '#fff'}} disabled hidden selected>Pages</MenuItem>].concat(pagesItems.map(comp => <MenuItem style={{ color: isThemeLight? '#000' : '#fff'}} value={comp.name}>{comp.name}</MenuItem>));
44+
const dropDown = [<MenuItem style={{ color: '#000' }} disabled hidden selected>Pages</MenuItem>].concat(pagesItems.map(comp => <MenuItem style={{ color: '#000' }} value={comp.name}>{comp.name}</MenuItem>));
3445

3546

3647
return (

app/src/components/top/NavBar.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,18 @@ const NavBar = (props) => {
247247
<StyledMenuItem
248248
className={classes.manageProject}
249249
onClick={handleClose}
250-
style = { { color: props.isThemeLight ? 'black' : 'white' } }
251250
>
252251
<SaveProjectButton />
253252
</StyledMenuItem>
254253
<StyledMenuItem
255254
className={classes.manageProject}
256255
onClick={handleClose}
257-
style = { { color: props.isThemeLight ? 'black' : 'white' } }
258256
>
259257
<ProjectsFolder />
260258
</StyledMenuItem>
261259
<StyledMenuItem
262260
className={classes.manageProject}
263261
onClick={handleClose}
264-
style = { { color: props.isThemeLight ? 'black' : 'white' } }
265262
>
266263
<DeleteProjects />
267264
</StyledMenuItem>

0 commit comments

Comments
 (0)