mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 08:34:25 +03:00
added new post button for all members of the notebook writers group
This commit is contained in:
parent
3e308fe15b
commit
7a64615cf7
@ -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
|
||||
: <Link to={newUrl} className="NotebookButton bg-light-green green2">
|
||||
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 =
|
||||
<Link to={newUrl} className="NotebookButton bg-light-green green2">
|
||||
New Post
|
||||
</Link>
|
||||
}
|
||||
}
|
||||
|
||||
let unsub = (window.ship === this.props.ship.slice(1))
|
||||
? null
|
||||
? null
|
||||
: <button onClick={this.unsubscribe}
|
||||
className="NotebookButton bg-white black ba b--black ml3">
|
||||
Unsubscribe
|
||||
|
@ -123,6 +123,7 @@ export class Root extends Component {
|
||||
view={view}
|
||||
ship={ship}
|
||||
book={notebook}
|
||||
groups={state.groups}
|
||||
{...props}
|
||||
/>
|
||||
</Skeleton>
|
||||
|
Loading…
Reference in New Issue
Block a user