From 240070b5da9e10e92b8b34327f56c93ac9e3c7e8 Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 1 Mar 2018 15:25:13 -0800 Subject: [PATCH 01/56] Use empty blob to save empty animation --- apps/src/gamelab/animationListModule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/src/gamelab/animationListModule.js b/apps/src/gamelab/animationListModule.js index bb9c01d3112c6..1cfeda1cf1ab4 100644 --- a/apps/src/gamelab/animationListModule.js +++ b/apps/src/gamelab/animationListModule.js @@ -339,7 +339,7 @@ export function addBlankAnimation() { version: null, loadedFromSource: true, saved: false, - blob: null, + blob: new Blob(), dataURI: null, hasNewVersionThisSession: false })); From f601378d9ced616185a9372af8f9a32b93e979c2 Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 3 Mar 2018 16:11:35 -0800 Subject: [PATCH 02/56] Resource Link component with story --- .../templates/instructions/ResourceLink.jsx | 93 +++++++++++++++++++ .../instructions/ResourceLink.story.jsx | 30 ++++++ 2 files changed, 123 insertions(+) create mode 100644 apps/src/templates/instructions/ResourceLink.jsx create mode 100644 apps/src/templates/instructions/ResourceLink.story.jsx diff --git a/apps/src/templates/instructions/ResourceLink.jsx b/apps/src/templates/instructions/ResourceLink.jsx new file mode 100644 index 0000000000000..3b97efc5c1198 --- /dev/null +++ b/apps/src/templates/instructions/ResourceLink.jsx @@ -0,0 +1,93 @@ +import React, { PropTypes } from 'react'; +import Radium from 'radium'; +import color from '@cdo/apps/util/color'; +import BaseDialog from '../BaseDialog'; + +const styles = { + textLink: { + display: 'inline-block', + margin: 8, + fontWeight: 'bold', + fontSize: 16, + lineHeight: '25px', + cursor: 'pointer', + maxWidth: '90%' + }, + mapThumbnail: { + backgroundColor: color.teal, + }, + commonThumbnail: { + borderRadius: 5, + paddingLeft: 26, + paddingRight: 26, + paddingTop: 16, + paddingBottom: 9, + }, + commonIcon: { + fontSize: 22, + }, + mapIcon: { + color: color.white + }, + resourceIcon: { + color: color.teal + }, + resourceStyle: { + margin: 8 + }, + linkFrame: { + width: '98%', + height: '94%' + } +}; + +class ResourceLink extends React.Component { + static propTypes = { + map: PropTypes.bool, + text: PropTypes.string.isRequired, + reference: PropTypes.string.isRequired, + }; + + state = { + dialogSelected: false, + text: this.props.reference + }; + + selectResource = () => { + this.setState({dialogSelected: true}); + }; + + closeResource = () => { + this.setState({dialogSelected: false}); + }; + + render() { + const { map, reference, text } = this.props; + + const iconStyle = map ? {...styles.commonIcon, ...styles.mapIcon} : {...styles.commonIcon, ...styles.resourceIcon}; + const thumbnailStyle = map ? {...styles.commonThumbnail, ...styles.mapThumbnail} : {...styles.commonThumbnail}; + + return ( +
+
+ + + + + {text} + +
+ +