Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 0 additions & 134 deletions src/components/costume-canvas/costume-canvas.jsx

This file was deleted.

2 changes: 2 additions & 0 deletions src/components/sprite-selector-item/sprite-selector-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
.sprite-image {
margin: auto;
user-select: none;
max-width: 32px;
max-height: 32px;
}

.sprite-info {
Expand Down
7 changes: 2 additions & 5 deletions src/components/sprite-selector-item/sprite-selector-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

import CostumeCanvas from '../costume-canvas/costume-canvas.jsx';
import CloseButton from '../close-button/close-button.jsx';
import styles from './sprite-selector-item.css';
import {ContextMenuTrigger} from 'react-contextmenu';
Expand Down Expand Up @@ -38,11 +37,9 @@ const SpriteSelectorItem = props => (
<div className={styles.number}>{props.number}</div>
)}
{props.costumeURL ? (
<CostumeCanvas
<img
className={styles.spriteImage}
height={32}
url={props.costumeURL}
width={32}
src={props.costumeURL}
/>
) : null}
<div className={styles.spriteInfo}>
Expand Down
2 changes: 2 additions & 0 deletions src/components/stage-selector/stage-selector.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ $header-height: calc($stage-menu-height - 2px);
border: 1px solid $ui-black-transparent;
border-radius: .25rem;
box-shadow: inset 0 0 4px $ui-black-transparent;
max-width: 64px;
max-height: 48px;
}

.add-button {
Expand Down
7 changes: 2 additions & 5 deletions src/components/stage-selector/stage-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {defineMessages, intlShape, injectIntl, FormattedMessage} from 'react-int

import Box from '../box/box.jsx';
import ActionMenu from '../action-menu/action-menu.jsx';
import CostumeCanvas from '../costume-canvas/costume-canvas.jsx';
import styles from './stage-selector.css';

import backdropIcon from '../action-menu/icon--backdrop.svg';
Expand Down Expand Up @@ -78,11 +77,9 @@ const StageSelector = props => {
</div>
</div>
{url ? (
<CostumeCanvas
<img
className={styles.costumeCanvas}
height={48}
url={url}
width={64}
src={url}
/>
) : null}
<div className={styles.label}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ exports[`SpriteSelectorItemComponent matches snapshot when given a number and de
>
5
</div>
<canvas
<img
className={undefined}
height={32}
style={
Object {
"height": "32px",
"width": "32px",
}
}
width={32}
src="https://scratch.mit.edu/foo/bar/pony"
/>
<div
className={undefined}
Expand Down Expand Up @@ -113,16 +106,9 @@ exports[`SpriteSelectorItemComponent matches snapshot when selected 1`] = `
src="test-file-stub"
/>
</div>
<canvas
<img
className={undefined}
height={32}
style={
Object {
"height": "32px",
"width": "32px",
}
}
width={32}
src="https://scratch.mit.edu/foo/bar/pony"
/>
<div
className={undefined}
Expand Down
12 changes: 0 additions & 12 deletions test/unit/components/sprite-selector-item.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import {mountWithIntl, shallowWithIntl, componentWithIntl} from '../../helpers/intl-helpers.jsx';
import SpriteSelectorItemComponent from '../../../src/components/sprite-selector-item/sprite-selector-item';
import CostumeCanvas from '../../../src/components/costume-canvas/costume-canvas';
import CloseButton from '../../../src/components/close-button/close-button';

describe('SpriteSelectorItemComponent', () => {
Expand Down Expand Up @@ -73,17 +72,6 @@ describe('SpriteSelectorItemComponent', () => {
expect(onDeleteButtonClick).toHaveBeenCalled();
});

test('creates a CostumeCanvas when a costume url is defined', () => {
const wrapper = shallowWithIntl(getComponent());
expect(wrapper.find(CostumeCanvas).exists()).toBe(true);
});

test('does not create a CostumeCanvas when a costume url is null', () => {
costumeURL = null;
const wrapper = shallowWithIntl(getComponent());
expect(wrapper.find(CostumeCanvas).exists()).toBe(false);
});

test('it has a context menu with delete menu item and callback', () => {
const wrapper = mountWithIntl(getComponent());
const contextMenu = wrapper.find('ContextMenu');
Expand Down