mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-20 01:54:01 +00:00
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import ClickedDiv from "../ClickedDiv";
|
|
import { close, setSkinFromUrl, openFileDialog } from "../../actionCreators";
|
|
import { ContextMenu, Hr, Node, Parent, LinkNode } from "../ContextMenu";
|
|
|
|
const MainContextMenu = props => (
|
|
<ContextMenu
|
|
id="option-context"
|
|
bottom
|
|
handle={<ClickedDiv id="option" title="Winamp Menu" />}
|
|
>
|
|
<LinkNode
|
|
href="https://github.com/captbaritone/winamp2-js"
|
|
target="_blank"
|
|
label="Winamp2-js"
|
|
/>
|
|
<Hr />
|
|
<Node onClick={props.openFileDialog} label="Play File..." />
|
|
<Parent label="Skins">
|
|
<Node onClick={props.openFileDialog} label="Load Skin..." />
|
|
{!!props.avaliableSkins.length && <Hr />}
|
|
{props.avaliableSkins.map(skin => (
|
|
<Node
|
|
key={skin.url}
|
|
onClick={() => props.setSkin(skin.url)}
|
|
label={skin.name}
|
|
/>
|
|
))}
|
|
</Parent>
|
|
<Hr />
|
|
<Node onClick={props.close} label="Exit" />
|
|
</ContextMenu>
|
|
);
|
|
|
|
const mapStateToProps = state => ({
|
|
avaliableSkins: state.settings.avaliableSkins
|
|
});
|
|
|
|
const mapDispatchToProps = { close, openFileDialog, setSkin: setSkinFromUrl };
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MainContextMenu);
|