From 7a64615cf7783dbe4d1a8ec38c1ad533433d3112 Mon Sep 17 00:00:00 2001 From: Isaac Visintainer Date: Fri, 7 Feb 2020 11:37:02 -0800 Subject: [PATCH] added new post button for all members of the notebook writers group --- .../publish/src/js/components/lib/notebook.js | 15 ++++++++++----- pkg/interface/publish/src/js/components/root.js | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/interface/publish/src/js/components/lib/notebook.js b/pkg/interface/publish/src/js/components/lib/notebook.js index dbc2e2050..5fa1fcde5 100644 --- a/pkg/interface/publish/src/js/components/lib/notebook.js +++ b/pkg/interface/publish/src/js/components/lib/notebook.js @@ -59,6 +59,7 @@ export class Notebook extends Component { render() { let notebook = this.props.notebooks[this.props.ship][this.props.book]; + let tabStyles = { posts: "bb b--gray4 gray2 pv4 ph2", about: "bb b--gray4 gray2 pv4 ph2" @@ -96,15 +97,19 @@ export class Notebook extends Component { let settings = base + '/settings'; let newUrl = base + '/new'; - let newPost = !(window.ship === this.props.ship.slice(1)) - // XX TODO check based on authorized writers instead - ? null - : + let newPost = null; + if (notebook["writers-group-path"] in this.props.groups){ + let writers = notebook["writers-group-path"]; + if (this.props.groups[writers].has(window.ship)) { + newPost = + New Post + } + } let unsub = (window.ship === this.props.ship.slice(1)) - ? null + ? null :