graphActionsBar.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import * as React from "react";
  2. import { ButtonLineComponent } from '../../../lines/buttonLineComponent';
  3. interface IGraphActionsBarProps {
  4. addKeyframe: () => void;
  5. removeKeyframe: () => void;
  6. handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  7. flatTangent: () => void;
  8. currentValue: number;
  9. }
  10. export class GraphActionsBar extends React.Component<IGraphActionsBarProps>{
  11. constructor(props: IGraphActionsBarProps) {
  12. super(props);
  13. }
  14. render() {
  15. return (
  16. <div className="actions-wrapper">
  17. <div className="action-input">
  18. <label>Value</label>
  19. <input type="number" value={this.props.currentValue.toFixed(3)} onChange={this.props.handleValueChange}/>
  20. </div>
  21. <ButtonLineComponent label={"Add Keyframe"} onClick={this.props.addKeyframe} />
  22. <ButtonLineComponent label={"Remove Keyframe"} onClick={this.props.removeKeyframe} />
  23. <ButtonLineComponent label={"Flat Tangent"} onClick={this.props.flatTangent} />
  24. </div>
  25. )
  26. }
  27. }