diff options
author | Vitaly Takmazov | 2018-12-10 17:13:45 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:54 +0300 |
commit | f9e29427a54c70d1208629a2ebf702841b1334ec (patch) | |
tree | e33b4f6a8021df0e73eda02f1b76cb16a51162db | |
parent | f0300b5403006b452f57fe6662f038733f04ee51 (diff) |
hide sidebar from anonymous
-rw-r--r-- | vnext/src/App.js | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js index e59fdb40..fe91be10 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -106,7 +106,13 @@ export default class App extends React.Component { <> <Header> <div id="header_wrapper"> - <NavigationIcon onToggle={this.toggleSidebar} /> + { + user.uid > 0 ? + <NavigationIcon onToggle={this.toggleSidebar} /> + : <div id="logo"> + <Link to="/">Juick</Link> + </div> + } <div id="logo" className="desktop"><Link to="/">Juick</Link></div> <div id="search" className="desktop"> <SearchBox pathname="/discover" onSearch={this.search} {...this.props} /> @@ -162,25 +168,28 @@ export default class App extends React.Component { <Route exact path="/:user/:mid" render={(props) => <Thread ref={this.thread} visitor={user} {...props} />} /> </Switch> </section> - <aside id="sidebar" ref={this.sidebar}> - <Avatar user={user} /> - <Link to="/?show=my"> - <Icon name="ei-clock" size="s" /> - <span className="desktop">My feed</span> - </Link> - <Link to="/pm"> - <Icon name="ei-envelope" size="s" /> - <span className="desktop">Messages</span> - </Link> - <Link to="/?show=discuss"> - <Icon name="ei-bell" size="s" /> - <span className="desktop">Discussions</span> - </Link> - <Link to="/settings" rel="nofollow"> - <Icon name="ei-gear" size="s" /> - <span className="desktop">Settings</span> - </Link> - </aside> + { + user.uid > 0 && + <aside id="sidebar" ref={this.sidebar}> + <Avatar user={user} /> + <Link to="/?show=my"> + <Icon name="ei-clock" size="s" /> + <span className="desktop">My feed</span> + </Link> + <Link to="/pm"> + <Icon name="ei-envelope" size="s" /> + <span className="desktop">Messages</span> + </Link> + <Link to="/?show=discuss"> + <Icon name="ei-bell" size="s" /> + <span className="desktop">Discussions</span> + </Link> + <Link to="/settings" rel="nofollow"> + <Icon name="ei-gear" size="s" /> + <span className="desktop">Settings</span> + </Link> + </aside> + } </> </Router> ); |