From 18dd7c6541efefeee45dcb7e911489a776f0639f Mon Sep 17 00:00:00 2001 From: catarak Date: Thu, 12 May 2016 18:11:09 -0400 Subject: [PATCH] add live updates when sketch is playing --- shared/components/Preview/PreviewFrame.jsx | 4 ++++ styles/components/_toolbar.scss | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/shared/components/Preview/PreviewFrame.jsx b/shared/components/Preview/PreviewFrame.jsx index 3bf8e90c..b0d2b21a 100644 --- a/shared/components/Preview/PreviewFrame.jsx +++ b/shared/components/Preview/PreviewFrame.jsx @@ -46,6 +46,10 @@ class PreviewFrame extends React.Component { this.clearPreview(); } } + + if (this.props.isPlaying && this.props.content != prevProps.content) { + this.renderSketch(); + } } componentWillUnmount() { diff --git a/styles/components/_toolbar.scss b/styles/components/_toolbar.scss index 2503cda9..f2f1775e 100644 --- a/styles/components/_toolbar.scss +++ b/styles/components/_toolbar.scss @@ -1,6 +1,12 @@ .toolbar__play-button { @extend %toolbar-button; margin-right: #{15 / $base-font-size}rem; + &.playing { + background-color: $light-button-background-hover-color; + & g { + fill: $light-button-hover-color; + } + } } .toolbar__stop-button {