Implement history form
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fab40f5cf7
commit
964d9a0e57
2 changed files with 38 additions and 1 deletions
10
src/App.tsx
10
src/App.tsx
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { Children } from 'react';
|
||||
import './App.scss';
|
||||
import Sidebar from './Components/Sidebar/Sidebar';
|
||||
import { ElementsSidebar } from './Components/ElementsSidebar/ElementsSidebar';
|
||||
|
@ -6,6 +6,7 @@ import { AvailableContainer } from './Interfaces/AvailableContainer';
|
|||
import { Configuration } from './Interfaces/Configuration';
|
||||
import { Container } from './Components/SVG/Elements/Container';
|
||||
import { SVG } from './Components/SVG/SVG';
|
||||
import { History } from './Components/History/History';
|
||||
|
||||
interface IAppProps {
|
||||
}
|
||||
|
@ -255,6 +256,12 @@ class App extends React.Component<IAppProps> {
|
|||
} as IAppState);
|
||||
}
|
||||
|
||||
public jumpTo(move: number): void {
|
||||
this.setState({
|
||||
historyCurrentStep: move
|
||||
} as IAppState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the application
|
||||
* @returns {JSX.Element} Rendered JSX element
|
||||
|
@ -282,6 +289,7 @@ class App extends React.Component<IAppProps> {
|
|||
<SVG selected={current.SelectedContainer}>
|
||||
{ current.MainContainer }
|
||||
</SVG>
|
||||
<History history={this.state.history} jumpTo={(move) => { this.jumpTo(move); }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue