mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
hide new post button when we don't have permission to post
This commit is contained in:
parent
9f126122de
commit
2fea43b568
@ -143,9 +143,11 @@ export class Blog extends Component {
|
||||
if (this.state.awaiting) {
|
||||
return null;
|
||||
} else {
|
||||
let create = (this.props.ship === window.ship);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PathControl pathData={data.pathData}/>
|
||||
<PC pathData={data.pathData} create={create}/>
|
||||
<div className="absolute"
|
||||
style={{top:124, marginLeft: 16, marginRight: 16, marginTop: 32}}>
|
||||
<div className="flex-col">
|
||||
|
@ -10,6 +10,7 @@ const PC = withRouter(PublishCreate);
|
||||
export class PathControl extends Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
|
||||
}
|
||||
|
||||
buildPathData(){
|
||||
@ -84,8 +85,11 @@ export class PathControl extends Component {
|
||||
}
|
||||
});
|
||||
|
||||
let create = ((window.location.pathname == '/~publish/new-blog') ||
|
||||
(window.location.pathname == '/~publish/new-post'))
|
||||
console.log("props", this.props);
|
||||
|
||||
let create = ((window.location.pathname === '/~publish/new-blog') ||
|
||||
(window.location.pathname === '/~publish/new-post')) ||
|
||||
(this.props.create === false)
|
||||
? false
|
||||
: 'post';
|
||||
|
||||
|
@ -379,9 +379,10 @@ export class Post extends Component {
|
||||
|
||||
let date = moment(this.state.post.info["date-created"]).fromNow();
|
||||
let authorDate = `${this.state.post.info.creator} • ${date}`;
|
||||
let create = (this.props.ship === window.ship);
|
||||
return (
|
||||
<div>
|
||||
<PathControl pathData={this.state.pathData}/>
|
||||
<PathControl pathData={this.state.pathData} create={create}/>
|
||||
<div className="absolute w-100" style={{top:124}}>
|
||||
<div className="mw-688 center mt4 flex-col" style={{flexBasis: 688}}>
|
||||
<Link to={blogLink}>
|
||||
@ -429,9 +430,10 @@ export class Post extends Component {
|
||||
|
||||
let date = moment(this.state.post.info["date-created"]).fromNow();
|
||||
let authorDate = `${this.state.post.info.creator} • ${date}`;
|
||||
let create = (this.props.ship === window.ship);
|
||||
return (
|
||||
<div>
|
||||
<PathControl pathData={this.state.pathData}/>
|
||||
<PathControl pathData={this.state.pathData} create={create}/>
|
||||
<div className="absolute w-100" style={{top:124}}>
|
||||
<div className="mw-688 center mt4 flex-col" style={{flexBasis: 688}}>
|
||||
<Link to={blogLink}>
|
||||
|
Loading…
Reference in New Issue
Block a user