Skip to content

Commit

Permalink
#22 connect settings panel with redux store
Browse files Browse the repository at this point in the history
  • Loading branch information
Salam-Dalloul committed Jan 18, 2024
1 parent 26b70c5 commit e54330f
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions src/components/NodeDetailView/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,44 @@ import SettingsGroup from "./SettingsGroup";
import FolderIcon from "@material-ui/icons/Folder";
import { useSelector, useDispatch } from 'react-redux'
import { toggleSettingsPanelVisibility } from '../../../redux/actions';
import React, {useEffect, useState} from "react";
import {DragDropContext, Droppable} from "react-beautiful-dnd";
import SettingsListItems from "./SettingsListItems";


const Settings = props => {
const dispatch = useDispatch();
const showSettingsContent = useSelector(state => state.sdsState.settings_panel_visible);

const metaDataPropertiesModel = useSelector(state => state.sdsState.metadata_model);
const [data, setData] = useState([])
const save = () => {
dispatch(toggleSettingsPanelVisibility(!showSettingsContent));
};

useEffect(() => {
setData(metaDataPropertiesModel)
}, [metaDataPropertiesModel])
return (
<Box style={{ position: "relative", maxHeight: "84vh", overflow: "auto" }}>
<Box
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
flexDirection: "column",
padding: "0rem 1.5rem 2.25rem 1.5rem",
boxShadow: "0px 2px 0px 0px #E5E5E5",
gap: ".75rem"
}}
>
<FolderIcon style={{ color: "#3779E1" }} />
<Typography variant="h3" style={{ color: "#3779E1" }}>
First List Title
</Typography>
</Box>
<SettingsGroup />
<SettingsGroup />
{/*<Box*/}
{/* style={{*/}
{/* display: "flex",*/}
{/* justifyContent: "center",*/}
{/* alignItems: "center",*/}
{/* flexDirection: "column",*/}
{/* padding: "0rem 1.5rem 2.25rem 1.5rem",*/}
{/* boxShadow: "0px 2px 0px 0px #E5E5E5",*/}
{/* gap: ".75rem"*/}
{/* }}*/}
{/*>*/}
{/* <FolderIcon style={{ color: "#3779E1" }} />*/}
{/* <Typography variant="h3" style={{ color: "#3779E1" }}>*/}
{/* First List Title*/}
{/* </Typography>*/}
{/*</Box>*/}
{
Object.keys(data).map(group => <SettingsGroup title={group} group={data[group]} />)
}
<Box
style={{
background:
Expand Down

0 comments on commit e54330f

Please sign in to comment.