diff --git a/js/components/App.js b/js/components/App.js index 2fec3878..47006e9a 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -26,10 +26,7 @@ const App = ({ media, fileInput, loading, closed, equalizer, playlist }) => { } return (
- - {/* This is not technically kosher, since ; -}; + + render() { + const { skinImages, skinCursors } = this.props; + if (!skinImages) { + return null; + } + const cssRules = []; + Object.keys(imageSelectors).map(imageName => { + const imageUrl = skinImages[imageName]; + if (imageUrl) { + imageSelectors[imageName].forEach(selector => { + cssRules.push( + `#winamp2-js ${selector} {background-image: url(${imageUrl})}` + ); + }); + } + }); + Object.keys(cursorSelectors).map(cursorName => { + const cursorUrl = skinCursors[cursorName]; + if (cursorUrl) { + cursorSelectors[cursorName].forEach(selector => { + cssRules.push( + `#winamp2-js ${selector} {cursor: url(${cursorUrl}), auto}` + ); + }); + } + }); + + if (numExIsUsed(skinImages)) { + // This alternate number file requires that the minus sign be + // formatted differently. + cssRules.push( + "#winamp2-js .status #time #minus-sign { top: 0px; left: -1px; width: 9px; height: 13px; }" + ); + } + return createPortal(cssRules.join("\n"), this.style); + } +} export default connect(state => ({ skinImages: state.display.skinImages,