Skip to content

Commit c177f5f

Browse files
committed
Add example of sprite that might be missing
1 parent 5ef8fea commit c177f5f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/webamp/js/components/GenWindow/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as Selectors from "../../selectors";
77
import ResizeTarget from "../ResizeTarget";
88
import { WindowId } from "../../types";
99
import FocusTarget from "../FocusTarget";
10-
import { useActionCreator, useTypedSelector } from "../../hooks";
10+
import { useActionCreator, useSprite, useTypedSelector } from "../../hooks";
1111

1212
interface TextProps {
1313
children: string;
@@ -54,13 +54,18 @@ export const GenWindow = ({ children, title, windowId, onKeyDown }: Props) => {
5454
const windowSize = getWindowSize(windowId);
5555
const selected = focusedWindow === windowId;
5656
const { width, height } = getWindowPixelSize(windowId);
57+
const topStyle = useSprite(
58+
selected
59+
? { base: "GEN_TOP_CENTER_FILL_SELECTED" }
60+
: { base: "GEN_TOP_CENTER_FILL" }
61+
);
5762
return (
5863
<FocusTarget windowId={windowId} onKeyDown={onKeyDown}>
5964
<div
6065
className={classnames("gen-window", "window", { selected })}
6166
style={{ width, height }}
6267
>
63-
<div className="gen-top draggable">
68+
<div className="gen-top draggable" style={topStyle}>
6469
<div className="gen-top-left draggable" />
6570
<div className="gen-top-left-fill draggable" />
6671
<div className="gen-top-left-end draggable" />

packages/webamp/js/skinSelectors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ export const imageSelectors: Selectors = {
279279
"#volume input:active::-webkit-slider-thumb",
280280
"#volume input:active::-moz-range-thumb",
281281
],
282-
GEN_TOP_CENTER_FILL: [".gen-window .gen-top"],
283282
GEN_TOP_LEFT: [".gen-window .gen-top-left"],
284283
GEN_TOP_LEFT_END: [".gen-window .gen-top-left-end"],
285284
GEN_TOP_RIGHT: [".gen-window .gen-top-right"],
@@ -289,7 +288,6 @@ export const imageSelectors: Selectors = {
289288
".gen-window .gen-top-right-fill",
290289
],
291290

292-
GEN_TOP_CENTER_FILL_SELECTED: [".gen-window.selected .gen-top"],
293291
GEN_TOP_LEFT_SELECTED: [".gen-window.selected .gen-top-left"],
294292
GEN_TOP_LEFT_END_SELECTED: [".gen-window.selected .gen-top-left-end"],
295293
GEN_TOP_RIGHT_SELECTED: [".gen-window.selected .gen-top-right"],

0 commit comments

Comments
 (0)