Commit da4cfb31 authored by Karishma Chadha's avatar Karishma Chadha

Track isScratcher status and pass hasCloudPermission flag to gui.

parent 80cf7137
...@@ -65,6 +65,7 @@ const PreviewPresentation = ({ ...@@ -65,6 +65,7 @@ const PreviewPresentation = ({
isFullScreen, isFullScreen,
isLoggedIn, isLoggedIn,
isNewScratcher, isNewScratcher,
isScratcher,
isShared, isShared,
justShared, justShared,
loveCount, loveCount,
...@@ -233,6 +234,7 @@ const PreviewPresentation = ({ ...@@ -233,6 +234,7 @@ const PreviewPresentation = ({
canSave={canSave} canSave={canSave}
className="guiPlayer" className="guiPlayer"
cloudHost={cloudHost} cloudHost={cloudHost}
hasCloudPermission={isScratcher}
isFullScreen={isFullScreen} isFullScreen={isFullScreen}
previewInfoVisible="false" previewInfoVisible="false"
projectHost={projectHost} projectHost={projectHost}
...@@ -548,6 +550,7 @@ PreviewPresentation.propTypes = { ...@@ -548,6 +550,7 @@ PreviewPresentation.propTypes = {
isFullScreen: PropTypes.bool, isFullScreen: PropTypes.bool,
isLoggedIn: PropTypes.bool, isLoggedIn: PropTypes.bool,
isNewScratcher: PropTypes.bool, isNewScratcher: PropTypes.bool,
isScratcher: PropTypes.bool,
isShared: PropTypes.bool, isShared: PropTypes.bool,
justShared: PropTypes.bool, justShared: PropTypes.bool,
loveCount: PropTypes.number, loveCount: PropTypes.number,
......
...@@ -477,6 +477,7 @@ class Preview extends React.Component { ...@@ -477,6 +477,7 @@ class Preview extends React.Component {
isFullScreen={this.state.isFullScreen} isFullScreen={this.state.isFullScreen}
isLoggedIn={this.props.isLoggedIn} isLoggedIn={this.props.isLoggedIn}
isNewScratcher={this.props.isNewScratcher} isNewScratcher={this.props.isNewScratcher}
isScratcher={this.props.isScratcher}
isShared={this.props.isShared} isShared={this.props.isShared}
justShared={this.state.justShared} justShared={this.state.justShared}
loveCount={this.state.loveCount} loveCount={this.state.loveCount}
...@@ -537,6 +538,7 @@ class Preview extends React.Component { ...@@ -537,6 +538,7 @@ class Preview extends React.Component {
className="gui" className="gui"
cloudHost={this.props.cloudHost} cloudHost={this.props.cloudHost}
enableCommunity={this.props.enableCommunity} enableCommunity={this.props.enableCommunity}
hasCloudPermission={this.props.isScratcher}
isShared={this.props.isShared} isShared={this.props.isShared}
projectHost={this.props.projectHost} projectHost={this.props.projectHost}
projectId={this.state.projectId} projectId={this.state.projectId}
...@@ -604,6 +606,7 @@ Preview.propTypes = { ...@@ -604,6 +606,7 @@ Preview.propTypes = {
isEditable: PropTypes.bool, isEditable: PropTypes.bool,
isLoggedIn: PropTypes.bool, isLoggedIn: PropTypes.bool,
isNewScratcher: PropTypes.bool, isNewScratcher: PropTypes.bool,
isScratcher: PropTypes.bool,
isShared: PropTypes.bool, isShared: PropTypes.bool,
loved: PropTypes.bool, loved: PropTypes.bool,
moreCommentsToLoad: PropTypes.bool, moreCommentsToLoad: PropTypes.bool,
...@@ -698,6 +701,7 @@ const mapStateToProps = state => { ...@@ -698,6 +701,7 @@ const mapStateToProps = state => {
isLoggedIn: isLoggedIn, isLoggedIn: isLoggedIn,
isAdmin: isAdmin, isAdmin: isAdmin,
isNewScratcher: isLoggedIn && state.permissions.new_scratcher, isNewScratcher: isLoggedIn && state.permissions.new_scratcher,
isScratcher: isLoggedIn && state.permissions.scratcher,
// if we don't have projectInfo, assume it's shared until we know otherwise // if we don't have projectInfo, assume it's shared until we know otherwise
isShared: !projectInfoPresent || state.preview.projectInfo.is_published, isShared: !projectInfoPresent || state.preview.projectInfo.is_published,
loved: state.preview.loved, loved: state.preview.loved,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment