mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
30 lines
911 B
TypeScript
30 lines
911 B
TypeScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import { openEqfFileDialog, downloadPreset } from "../../actionCreators";
|
|
import { Node } from "../ContextMenu";
|
|
import ContextMenuTarget from "../ContextMenuTarget";
|
|
import { Dispatch } from "../../types";
|
|
|
|
interface DispatchProps {
|
|
openEqfFileDialog(): void;
|
|
downloadPreset(): void;
|
|
}
|
|
|
|
const PresetsContextMenu = (props: DispatchProps) => (
|
|
<ContextMenuTarget top id="presets-context" handle={<div id="presets" />}>
|
|
<Node onClick={props.openEqfFileDialog} label="Load" />
|
|
<Node onClick={props.downloadPreset} label="Save" />
|
|
</ContextMenuTarget>
|
|
);
|
|
|
|
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
|
|
return {
|
|
openEqfFileDialog: () => dispatch(openEqfFileDialog()),
|
|
downloadPreset: () => dispatch(downloadPreset())
|
|
};
|
|
};
|
|
|
|
export default connect(
|
|
null,
|
|
mapDispatchToProps
|
|
)(PresetsContextMenu);
|