diff --git a/src/App.tsx b/src/App.tsx index 89fae1a..8a0893d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,6 @@ import React from 'react'; import './App.scss'; import Sidebar from './Components/Sidebar/Sidebar'; -import { SVGSidebar } from './Components/SVGSidebar/SVGSidebar'; import { AvailableContainer } from './Interfaces/AvailableContainer'; import { Configuration } from './Interfaces/Configuration'; import { SVG } from './SVG/SVG'; @@ -11,7 +10,6 @@ interface IAppProps { interface IAppState { isSidebarOpen: boolean, - isSVGSidebarOpen: boolean, configuration: Configuration } @@ -22,7 +20,6 @@ class App extends React.Component { super(props); this.state = { isSidebarOpen: true, - isSVGSidebarOpen: true, configuration: { AvailableContainers: [], AvailableSymbols: [], @@ -33,34 +30,25 @@ class App extends React.Component { componentDidMount() { fetchConfiguration().then((configuration: Configuration) => { - this.setState(prevState => ({ - ...prevState, + this.setState({ + isSidebarOpen: this.state.isSidebarOpen, configuration - })); + }); }); } - public ToggleSidebar() { - this.setState(prevState => ({ - ...prevState, - isSidebarOpen: !this.state.isSidebarOpen - } as IAppState)); - } - - public ToggleSVGSidebar() { - this.setState(prevState => ({ - ...prevState, - isSVGSidebarOpen: !this.state.isSVGSidebarOpen - } as IAppState)); + public ToggleMenu() { + this.setState({ + isSidebarOpen: !this.state.isSidebarOpen, + configuration: this.state.configuration + }); } render() { return (
- this.ToggleSidebar()} /> - - this.ToggleSVGSidebar()}/> - + this.ToggleMenu()} /> +
); diff --git a/src/Components/SVGSidebar/SVGSidebar.tsx b/src/Components/SVGSidebar/SVGSidebar.tsx deleted file mode 100644 index 2a00072..0000000 --- a/src/Components/SVGSidebar/SVGSidebar.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react'; - -interface ISVGSidebarProps { - isOpen: boolean; - onClick: () => void; -} - -export class SVGSidebar extends React.Component { - public render() { - const isOpenClasses = this.props.isOpen ? 'right-0' : '-right-64'; - return ( -
-
- -
-
- Liste des éléments -
-
- ); - } -} diff --git a/src/Components/Sidebar/Sidebar.tsx b/src/Components/Sidebar/Sidebar.tsx index 41bcd14..c8fd740 100644 --- a/src/Components/Sidebar/Sidebar.tsx +++ b/src/Components/Sidebar/Sidebar.tsx @@ -10,7 +10,7 @@ interface ISidebarProps { export default class Sidebar extends React.Component { public render() { const listElements = this.props.componentOptions.map(componentOption => - ); diff --git a/test-server/http.js b/test-server/http.js index b375794..d096cef 100644 --- a/test-server/http.js +++ b/test-server/http.js @@ -18,7 +18,7 @@ serve({ MaxWidth: 3000 } ], - AvailableSymbols: [], + AvailableSymbolModels: [], MainContainer: { Type: 'Trou', BorderColor: '#ffffff',