Skip to content

Commit

Permalink
Add example of sprite that might be missing
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed Oct 2, 2020
1 parent 5ef8fea commit c177f5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/webamp/js/components/GenWindow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Selectors from "../../selectors";
import ResizeTarget from "../ResizeTarget";
import { WindowId } from "../../types";
import FocusTarget from "../FocusTarget";
import { useActionCreator, useTypedSelector } from "../../hooks";
import { useActionCreator, useSprite, useTypedSelector } from "../../hooks";

interface TextProps {
children: string;
Expand Down Expand Up @@ -54,13 +54,18 @@ export const GenWindow = ({ children, title, windowId, onKeyDown }: Props) => {
const windowSize = getWindowSize(windowId);
const selected = focusedWindow === windowId;
const { width, height } = getWindowPixelSize(windowId);
const topStyle = useSprite(
selected
? { base: "GEN_TOP_CENTER_FILL_SELECTED" }
: { base: "GEN_TOP_CENTER_FILL" }
);
return (
<FocusTarget windowId={windowId} onKeyDown={onKeyDown}>
<div
className={classnames("gen-window", "window", { selected })}
style={{ width, height }}
>
<div className="gen-top draggable">
<div className="gen-top draggable" style={topStyle}>
<div className="gen-top-left draggable" />
<div className="gen-top-left-fill draggable" />
<div className="gen-top-left-end draggable" />
Expand Down
2 changes: 0 additions & 2 deletions packages/webamp/js/skinSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ export const imageSelectors: Selectors = {
"#volume input:active::-webkit-slider-thumb",
"#volume input:active::-moz-range-thumb",
],
GEN_TOP_CENTER_FILL: [".gen-window .gen-top"],
GEN_TOP_LEFT: [".gen-window .gen-top-left"],
GEN_TOP_LEFT_END: [".gen-window .gen-top-left-end"],
GEN_TOP_RIGHT: [".gen-window .gen-top-right"],
Expand All @@ -289,7 +288,6 @@ export const imageSelectors: Selectors = {
".gen-window .gen-top-right-fill",
],

GEN_TOP_CENTER_FILL_SELECTED: [".gen-window.selected .gen-top"],
GEN_TOP_LEFT_SELECTED: [".gen-window.selected .gen-top-left"],
GEN_TOP_LEFT_END_SELECTED: [".gen-window.selected .gen-top-left-end"],
GEN_TOP_RIGHT_SELECTED: [".gen-window.selected .gen-top-right"],
Expand Down

0 comments on commit c177f5f

Please sign in to comment.