Skip to content

Commit 3ae3817

Browse files
authored
Merge pull request #23 from oslabs-beta/katrina1
Index routing bug fixed, modal text color corrected.
2 parents 3e92088 + b9f7f24 commit 3ae3817

File tree

6 files changed

+27
-11
lines changed

6 files changed

+27
-11
lines changed

app/src/components/main/AddLink.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function AddLink({ id, onClickHandler, linkDisplayed }) {
1515
const [link, setLink] = useState('')
1616

1717
const handlePageSelect = event => {
18+
console.log('hit');
1819
const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
1920
currComponent.children.some(element => {
2021
if(element.childId === id) {

app/src/components/right/DeleteProjects.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ function ProjectsDialog(props: ProjectDialogProps) {
5151
aria-labelledby="project-dialog-title"
5252
open={open}
5353
>
54-
<DialogTitle id="project-dialog-title">Delete Project</DialogTitle>
55-
<List>
54+
<DialogTitle style={{ color: "#000" }} id="project-dialog-title">Delete Project</DialogTitle>
55+
<List style={{ color: "#000" }}>
5656
{projects.map((project: any, index: number) => (
5757
<ListItem
5858
button

app/src/components/right/OpenProjects.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ function ProjectsDialog(props: ProjectDialogProps) {
4141
aria-labelledby="project-dialog-title"
4242
open={open}
4343
>
44-
<DialogTitle id="project-dialog-title">Open Project</DialogTitle>
45-
<List>
44+
<DialogTitle style={{ color: "#000" }} id="project-dialog-title">Open Project</DialogTitle>
45+
<List style={{ color: "#000" }}>
4646
{projects.map((project: any, index: number) => (
4747
<ListItem
4848
button
@@ -61,7 +61,7 @@ function ProjectsDialog(props: ProjectDialogProps) {
6161
</Dialog>
6262
);
6363
}
64-
export default function ProjectsFolder() {
64+
export default function ProjectsFolder(props) {
6565
const [open, setOpen] = useState(false);
6666
const [projects, setProjects] = useState([{ hello: 'cat' }])
6767

app/src/components/right/SaveProjectButton.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ export default function FormDialog() {
6767
SAVE PROJECT AS
6868
</Button>
6969
<Dialog
70+
style={{ color: "#000" }}
7071
open={open}
7172
onClose={handleClose}
7273
aria-labelledby="form-dialog-title"
7374
>
74-
<DialogTitle id="form-dialog-title">Save Project</DialogTitle>
75+
<DialogTitle style={{ color: "#000" }} id="form-dialog-title">Save Project</DialogTitle>
7576
<DialogContent>
7677
<TextField
7778
autoFocus
79+
inputProps={{ style: { color: "black" } }}
7880
margin="dense"
7981
id="name"
8082
label="Project Name"
@@ -87,10 +89,10 @@ export default function FormDialog() {
8789
/>
8890
</DialogContent>
8991
<DialogActions>
90-
<Button onClick={handleClose} color="primary">
92+
<Button onClick={handleClose} color='primary'>
9193
Cancel
9294
</Button>
93-
<Button onClick={handleSave} color="primary">
95+
<Button onClick={handleSave} color='primary'>
9496
Save
9597
</Button>
9698
</DialogActions>

app/src/components/top/NavBar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,21 @@ const NavBar = (props) => {
247247
<StyledMenuItem
248248
className={classes.manageProject}
249249
onClick={handleClose}
250+
style = { { color: props.isThemeLight ? 'black' : 'white' } }
250251
>
251252
<SaveProjectButton />
252253
</StyledMenuItem>
253254
<StyledMenuItem
254255
className={classes.manageProject}
255256
onClick={handleClose}
257+
style = { { color: props.isThemeLight ? 'black' : 'white' } }
256258
>
257259
<ProjectsFolder />
258260
</StyledMenuItem>
259261
<StyledMenuItem
260262
className={classes.manageProject}
261263
onClick={handleClose}
264+
style = { { color: props.isThemeLight ? 'black' : 'white' } }
262265
>
263266
<DeleteProjects />
264267
</StyledMenuItem>

app/src/containers/CustomizationPanel.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
4848
const [useContextObj, setUseContextObj] = useState({});
4949
const [stateUsedObj, setStateUsedObj] = useState({});
5050

51+
52+
const currFocus = state.components
53+
.find((el) => {
54+
return el.id === state.canvasFocus.componentId
55+
})
56+
.children.find((el) => {
57+
return el.childId === state.canvasFocus.componentId;
58+
});
59+
60+
useEffect( () => {
61+
currFocus?.attributes?.compLink && setCompLink(currFocus.attributes.compLink);
62+
}, [currFocus?.attributes?.compLink]);
63+
5164
//Miko -- save properties of nested div
5265
function deepIterate(arr) {
5366
const output = [];
@@ -87,9 +100,6 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
87100
// after component renders, reset the input fields with the current styles of the selected child
88101
useEffect(() => {
89102
resetFields();
90-
// const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
91-
// const childrenArray = currComponent.children;
92-
// console.log('childrenArray', childrenArray)
93103
}, [state.canvasFocus.componentId, state.canvasFocus.childId]);
94104
// handles all input field changes, with specific updates called based on input's name
95105
const handleChange = (e: React.ChangeEvent<{ value: any }>) => {

0 commit comments

Comments
 (0)