From cf631f995664f8678d3ff3ed78a9dfbe2450bfd8 Mon Sep 17 00:00:00 2001 From: Martina Date: Tue, 25 Aug 2020 16:13:17 -0700 Subject: [PATCH] commit --- components/core/Profile.js | 2 +- scenes/SceneSlate.js | 12 ++++++++++-- scenes/SceneSlates.js | 16 +++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/components/core/Profile.js b/components/core/Profile.js index 801990c8..dc60b62d 100644 --- a/components/core/Profile.js +++ b/components/core/Profile.js @@ -76,7 +76,7 @@ export default class Profile extends React.Component { type: "NAVIGATE", value: this.props.sceneId, scene: "SLATE", - data: slate, + data: { owner: data, ...slate }, }) } > diff --git a/scenes/SceneSlate.js b/scenes/SceneSlate.js index 0019d6c3..9cdf2642 100644 --- a/scenes/SceneSlate.js +++ b/scenes/SceneSlate.js @@ -23,6 +23,7 @@ const moveIndex = (set, fromIndex, toIndex) => { export default class SceneSlate extends React.Component { state = { name: this.props.data.data.name, + username: this.props.data.owner.username, slatename: this.props.data.slatename, public: this.props.data.data.public, objects: this.props.data.data.objects, @@ -63,6 +64,7 @@ export default class SceneSlate extends React.Component { } this.setState({ + username: this.props.data.owner.username, slatename: this.props.data.slatename, public: this.props.data.data.public, objects: this.props.data.data.objects, @@ -264,13 +266,19 @@ export default class SceneSlate extends React.Component { }; render() { - const { slatename, objects, body = "A slate.", name } = this.state; + const { + username, + slatename, + objects, + body = "A slate.", + name, + } = this.state; return ( diff --git a/scenes/SceneSlates.js b/scenes/SceneSlates.js index babd3897..70622efb 100644 --- a/scenes/SceneSlates.js +++ b/scenes/SceneSlates.js @@ -31,14 +31,24 @@ export default class SceneSlates extends React.Component { const slateButtons = [ { name: "Create slate", type: "SIDEBAR", value: "SIDEBAR_CREATE_SLATE" }, ]; - + console.log(this.props); return ( This scene is currently a work in progress. - {this.props.viewer.slates.map((slate) => ( - + {this.props.data.children.map((slate) => ( +
+ // this.props.onAction({ + // type: "NAVIGATE", + // value: slate.id, + // }) + // } + > + +
))}
);