Refactor Editor and module functions (#15)
All checks were successful
continuous-integration/drone/push Build is passing

Moved all module functions to separate utils modules

Replaced standard with standard with typescript

Extracted UI elements to separate component

Reviewed-on: https://git.siklos-chaneru.duckdns.org/Siklos/svg-layout-designer-react/pulls/15
This commit is contained in:
Siklos 2022-08-05 15:38:44 -04:00
parent 8e34d6b72a
commit 293af45144
26 changed files with 477 additions and 367 deletions

View file

@ -2,19 +2,19 @@ import * as React from 'react';
import { IHistoryState } from '../../App';
interface IHistoryProps {
history: IHistoryState[],
historyCurrentStep: number,
isOpen: boolean,
onClick: () => void,
history: IHistoryState[]
historyCurrentStep: number
isOpen: boolean
onClick: () => void
jumpTo: (move: number) => void
}
export class History extends React.PureComponent<IHistoryProps> {
public render() {
public render(): JSX.Element {
const isOpenClasses = this.props.isOpen ? 'right-0' : '-right-64';
const states = this.props.history.map((step, move) => {
const desc = move
const desc = move > 0
? `Go to modification n°${move}`
: 'Go to the beginning';